This commit is contained in:
Tibor Bossanyi
2023-03-28 15:36:37 +02:00
parent 3c212320e5
commit 953753196b
3 changed files with 22 additions and 14 deletions
+9 -5
View File
@@ -27,7 +27,7 @@ class APIWebClient with Common, Logging {
final body = jsonEncode(<String, String>{'username': email, 'password': password});
var uri = Uri.parse(url);
var result = await http.post(uri, body: body, headers: {
"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu',
"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu, http://localhost',
"Content-Type": "application/json",
"Authorization": "1",
});
@@ -65,8 +65,10 @@ class APIWebClient with Common, Logging {
}
var uri = Uri.parse(url);
var result = await http.post(uri, body: body, headers: {
//"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu',
"Access-Control-Allow-Origin": '*',
"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu, http://localhost',
"Access-Control-Allow-Headers": "Origin,Content-Type,Authorization,locale",
"Access-Control-Allow-Credentials": 'true', // Required for cookies, authorization headers with HTTPS
"Access-Control-Allow-Methods": "POST, GET, OPTIONS",
"Content-Type": "application/json",
"Authorization": 'Bearer $authToken',
});
@@ -100,8 +102,10 @@ class APIWebClient with Common, Logging {
var uri = Uri.parse(url);
var result = await http.get(uri, headers: {
"Content-Type": "application/json",
//"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu',
"Access-Control-Allow-Origin": '*',
"Access-Control-Allow-Origin": 'https://*.diet4you.eu, https://*.diet4you.hu, http://localhost',
"Access-Control-Allow-Headers": "Origin,Content-Type,Authorization,locale",
"Access-Control-Allow-Credentials": 'true', // Required for cookies, authorization headers with HTTPS
"Access-Control-Allow-Methods": "POST, GET, OPTIONS",
"Authorization": 'Bearer $authToken',
});