Cherry-picked c03df2b74e into v13/dev

This commit is contained in:
Jacob Overgaard
2023-11-10 13:45:00 +01:00
parent 81caf2b384
commit f4cb7e71fa

View File

@@ -34,9 +34,6 @@ export class UmbAuthRepository {
return responseData;
}
// Additionally authenticate with the Management API
await this.#managementApiLogin(data.username, data.password);
try {
const text = await response.text();
if (text) {
@@ -275,24 +272,4 @@ export class UmbAuthRepository {
return text;
}
async #managementApiLogin(username: string, password: string) {
try {
const authURLManagementApi = 'management/api/v1/security/back-office/login';
const requestManagementApi = new Request(authURLManagementApi, {
method: 'POST',
body: JSON.stringify({
username,
password,
}),
headers: {
'Content-Type': 'application/json',
},
});
return await fetch(requestManagementApi);
} catch (error) {
console.error('Failed to authenticate with the Management API:', error);
}
}
}