diff --git a/README.md b/README.md index f0fe077..d75432e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ Workout Test and Diet 4 You Common Util Functions +### Version 1.0.22 + +webapi CORS: only diet4you domains, plugins update + ### Version 1.0.21 webapi CORS: test all domains diff --git a/lib/service/webapi.dart b/lib/service/webapi.dart index 6489802..d9af7a5 100644 --- a/lib/service/webapi.dart +++ b/lib/service/webapi.dart @@ -27,7 +27,7 @@ class APIWebClient with Common, Logging { final body = jsonEncode({'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', }); diff --git a/pubspec.yaml b/pubspec.yaml index 95b70ba..b516faf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: workouttest_util description: Workout Test app and web functions. -version: 1.0.21 +version: 1.0.22 environment: sdk: ">=2.18.6 <3.0.0" @@ -12,14 +12,14 @@ dependencies: crypto: ^3.0.2 - firebase_auth: ^4.2.9 - firebase_analytics: ^10.1.0 - firebase_core: ^2.7.0 - firebase_messaging: ^14.2.1 - firebase_remote_config: ^3.0.9 + firebase_auth: ^4.3.0 + firebase_analytics: ^10.1.6 + firebase_core: ^2.8.0 + firebase_messaging: ^14.3.0 + firebase_remote_config: ^3.0.15 flutter_facebook_auth: ^5.0.7 flutter_dotenv: ^5.0.2 - google_sign_in: ^5.4.3 + google_sign_in: ^6.0.2 http: ^0.13.5 @@ -31,8 +31,8 @@ dependencies: package_info_plus: ^3.0.2 - sentry_flutter: ^6.9.1 - shared_preferences: ^2.0.17 + sentry_flutter: ^7.3.0 + shared_preferences: ^2.0.20 posthog_session: git: