feat(auth): prepare MSAL browser integration
This commit is contained in:
@@ -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 (_) {
|
||||
|
||||
Reference in New Issue
Block a user