6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 99e34d11
Changed files
comwell_key_app/lib/common/const.dart | 1 - comwell_key_app/lib/data/remote/msal_service.dart | 9 ++------- comwell_key_app/lib/utils/locator.dart | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-)
Diff
diff --git a/comwell_key_app/lib/common/const.dart b/comwell_key_app/lib/common/const.dart
index c4a917bc..6d503870 100644
--- a/comwell_key_app/lib/common/const.dart
+++ b/comwell_key_app/lib/common/const.dart
@@ -1,4 +1,3 @@
-const accessToken = 'access_token';
const refreshToken = 'refresh_token';
const identifier = 'identifier';
const correlationId = 'correlation_id';
diff --git a/comwell_key_app/lib/data/remote/msal_service.dart b/comwell_key_app/lib/data/remote/msal_service.dart
index 9f5f4e88..c53a7dca 100644
--- a/comwell_key_app/lib/data/remote/msal_service.dart
+++ b/comwell_key_app/lib/data/remote/msal_service.dart
@@ -1,22 +1,18 @@
import 'package:comwell_key_app/.generated/assets/assets.gen.dart';
import 'package:comwell_key_app/utils/env_utils.dart';
-import 'package:comwell_key_app/utils/secure_storage.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';
-import '../../common/const.dart' as constants;
-
class MSALService {
- final SecureStorage _secureStorage;
final scopes = dotenv.ENTRA_API_URL.split(',');
final authorityUrl = dotenv.ENTRA_ID_AUTHORITY_URL;
late final PublicClientApplication msAuth;
late final String configFilePath;
- MSALService(this._secureStorage);
+ MSALService();
Future<void> init() async {
try {
@@ -51,8 +47,7 @@ class MSALService {
}
Future<void> openAuth(Prompt prompt) async {
- final response = await msAuth.acquireToken(scopes: scopes, prompt: prompt);
- await _secureStorage.write(constants.accessToken, response.accessToken);
+ await msAuth.acquireToken(scopes: scopes, prompt: prompt);
}
Future<String> acquireTokenSilent() async {
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 299760c4..2b9d07c8 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -50,7 +50,7 @@ void setupLocator() {
locator.registerSingleton(ComwellTracking());
registerDatabase();
locator.registerSingleton(SecureStorage());
- locator.registerSingleton(MSALService(locator.get()));
+ locator.registerSingleton(MSALService());
locator.registerSingleton(SeosMobileKeysPlugin());
locator.registerSingleton(ComwellHttpClient());
locator.registerSingleton(Api());