6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 92f0b36e
Changed files
comwell_key_app/assets/msal/msal_config_stage.json | 12 +++---- comwell_key_app/lib/data/remote/msal_service.dart | 5 +-- comwell_key_app/lib/main.dart | 42 ++++++++++------------ .../interceptors/response_handle_interceptor.dart | 2 +- comwell_key_app/lib/utils/locator.dart | 5 --- 5 files changed, 27 insertions(+), 39 deletions(-)
Diff
diff --git a/comwell_key_app/assets/msal/msal_config_stage.json b/comwell_key_app/assets/msal/msal_config_stage.json
index 9e59b7c4..9a962b27 100644
--- a/comwell_key_app/assets/msal/msal_config_stage.json
+++ b/comwell_key_app/assets/msal/msal_config_stage.json
@@ -1,17 +1,17 @@
{
- "client_id" : "19a8eb05-01e0-4076-9db3-34bcfefd67d8",
+ "client_id" : "b7cdbf4c-39d3-4c20-bff5-c0566f8bec0b",
"redirect_uri" : "msauth://com.comwell.phoenix.stage/VzSiQcXRmi2kyjzcA%2BmYLEtbGVs%3D",
- "shared_device_mode_supported": true,
"broker_redirect_uri_registered": false,
"account_mode": "SINGLE",
- "authorization_user_agent": "BROWSER",
"authorities" : [
{
- "type": "AAD",
+ "type": "B2C",
+ "authority_url": "https://comwellidstage.ciamlogin.com/comwellidstage.onmicrosoft.com",
"audience": {
"type": "AzureADMyOrg",
- "tenant_id": "8392ed03-7f96-414a-bc94-4f16dc0b9cf4"
- }
+ "tenant_id": "1e38b065-3224-4155-88e2a5af1c4aa98d"
+ },
+ "default": true
}
]
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/data/remote/msal_service.dart b/comwell_key_app/lib/data/remote/msal_service.dart
index c53a7dca..32080216 100644
--- a/comwell_key_app/lib/data/remote/msal_service.dart
+++ b/comwell_key_app/lib/data/remote/msal_service.dart
@@ -1,12 +1,10 @@
import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
import 'package:comwell_key_app/utils/env_utils.dart';
-import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:msal_auth/msal_auth.dart';
class MSALService {
-
final scopes = dotenv.ENTRA_API_URL.split(',');
final authorityUrl = dotenv.ENTRA_ID_AUTHORITY_URL;
late final PublicClientApplication msAuth;
@@ -41,8 +39,7 @@ class MSALService {
),
);
} catch (e) {
- debugPrint("qqq msauth init=$e");
- rethrow;
+ print("qqq msauth init=$e");
}
}
diff --git a/comwell_key_app/lib/main.dart b/comwell_key_app/lib/main.dart
index 2f0f5d84..e5566817 100644
--- a/comwell_key_app/lib/main.dart
+++ b/comwell_key_app/lib/main.dart
@@ -33,31 +33,8 @@ Future<void> runMainApp(FirebaseOptions firebaseOptions, String envFile) async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
debugPrint("Current flavor: $appFlavor");
- debugPrint("Loading environment file: $envFile");
-
try {
await dotenv.load(fileName: envFile);
- debugPrint("Successfully loaded environment file");
- } catch (e) {
- debugPrint("Error loading environment file: $e");
- rethrow;
- }
-
- // Render UI immediately; do heavy initialization after first frame to avoid ANR.
- runApp(
- EasyLocalization(
- supportedLocales: const [Locale('en', 'US'), Locale('da', 'DK')],
- path: 'assets/translations',
- fallbackLocale: const Locale('da', 'DK'),
- child: const _BootstrapApp(),
- ),
- );
-}
-
-class _BootstrapApp extends StatelessWidget {
- const _BootstrapApp();
-
- Future<void> _initialize() async {
await configureFirebase();
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
setupLocator();
@@ -77,7 +54,26 @@ class _BootstrapApp extends StatelessWidget {
dio: locator.get<ComwellHttpClient>().dio,
),
);
+ } catch (e) {
+ debugPrint("Error loading environment file: $e");
+ rethrow;
+ }
+
+ // Render UI immediately; do heavy initialization after first frame to avoid ANR.
+ runApp(
+ EasyLocalization(
+ supportedLocales: const [Locale('en', 'US'), Locale('da', 'DK')],
+ path: 'assets/translations',
+ fallbackLocale: const Locale('da', 'DK'),
+ child: const _BootstrapApp(),
+ ),
+ );
+}
+class _BootstrapApp extends StatelessWidget {
+ const _BootstrapApp();
+
+ Future<void> _initialize() async {
// Setting System UI overlay
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
diff --git a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
index 40c7f0a4..d0c53d95 100644
--- a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
+++ b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
@@ -15,7 +15,7 @@ class ResponseHandleInterceptor extends Interceptor {
BuildContext? get context {
final navigatorKey = locator<GlobalKey<NavigatorState>>();
- return navigatorKey.currentContext!;
+ return navigatorKey.currentContext;
}
Future<void> checkAuth(RequestOptions requestOptions) async {
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 672d0594..5fe2538d 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -89,10 +89,5 @@ void setupLocator() {
locator.registerFactory(() => BluetoothRepository());
locator.registerFactory(() => InternetStatusRepository());
locator.registerFactory(() => AdyenRepository(dio: locator.get<ComwellHttpClient>().dio));
- locator.registerFactory<AdyenRepository>(
- () => AdyenRepository(
- dio: ComwellHttpClient().dio,
- ),
- );
}
}