feat(auth): prepare MSAL browser integration

This commit is contained in:
SaidSoighiri94
2026-07-23 13:38:20 +02:00
parent 530bd52cb5
commit ef31e2ab8c
8 changed files with 885 additions and 12 deletions
+8 -10
View File
@@ -37,7 +37,8 @@ class ApiClient {
late final http.Response reponse;
try {
reponse = await http.get(uri, headers: AuthService.requestHeaders());
final authHeaders = await AuthService.requestHeaders();
reponse = await http.get(uri, headers: authHeaders);
} catch (_) {
throw const ApiException(
"Impossible de joindre le serveur. Vérifiez que le backend est démarré.",
@@ -58,7 +59,8 @@ class ApiClient {
late final http.Response reponse;
try {
reponse = await http.get(uri, headers: AuthService.requestHeaders());
final authHeaders = await AuthService.requestHeaders();
reponse = await http.get(uri, headers: authHeaders);
} catch (_) {
throw const ApiException(
"Impossible de joindre le serveur. Vérifiez que le backend est démarré.",
@@ -82,12 +84,10 @@ class ApiClient {
late final http.Response reponse;
try {
final authHeaders = await AuthService.requestHeaders();
reponse = await http.post(
uri,
headers: {
...AuthService.requestHeaders(),
"content-type": "application/json",
},
headers: {...authHeaders, "content-type": "application/json"},
body: jsonEncode(body),
);
} catch (_) {
@@ -107,12 +107,10 @@ class ApiClient {
late final http.Response reponse;
try {
final authHeaders = await AuthService.requestHeaders();
reponse = await http.patch(
uri,
headers: {
...AuthService.requestHeaders(),
"content-type": "application/json",
},
headers: {...authHeaders, "content-type": "application/json"},
body: jsonEncode(body),
);
} catch (_) {