chore(frontend): Refactoring
Refactoring zodat de structuur van de authenticatieservice in de client duidelijker is.
This commit is contained in:
parent
a28ec22f29
commit
26d5c09bb4
19 changed files with 215 additions and 183 deletions
24
frontend/src/services/auth/auth-config-loader.ts
Normal file
24
frontend/src/services/auth/auth-config-loader.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import apiClient from "@/services/api-client.ts";
|
||||
import type {FrontendAuthConfig} from "@/services/auth/auth-types.ts";
|
||||
|
||||
export async function loadAuthConfig() {
|
||||
const authConfig = (await apiClient.get<FrontendAuthConfig>("auth/config")).data;
|
||||
return {
|
||||
student: {
|
||||
authority: authConfig.student.authority,
|
||||
client_id: authConfig.student.clientId,
|
||||
redirect_uri: window.location.origin + "/callback",
|
||||
response_type: authConfig.student.responseType,
|
||||
scope: authConfig.student.scope,
|
||||
post_logout_redirect_uri: window.location.origin,
|
||||
},
|
||||
teacher: {
|
||||
authority: authConfig.teacher.authority,
|
||||
client_id: authConfig.teacher.clientId,
|
||||
redirect_uri: window.location.origin + "/callback",
|
||||
response_type: authConfig.teacher.responseType,
|
||||
scope: authConfig.teacher.scope,
|
||||
post_logout_redirect_uri: window.location.origin,
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue