feat(frontend): Added functionality to the frontend to log in.
This commit is contained in:
parent
4a1edbb6ff
commit
a28ec22f29
20 changed files with 395 additions and 33 deletions
33
backend/src/controllers/auth.ts
Normal file
33
backend/src/controllers/auth.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import {EnvVars, getEnvVar} from "../util/envvars";
|
||||
|
||||
type FrontendAuthConfig = {
|
||||
student: FrontendIdpConfig,
|
||||
teacher: FrontendIdpConfig
|
||||
}
|
||||
|
||||
type FrontendIdpConfig = {
|
||||
authority: string,
|
||||
clientId: string,
|
||||
scope: string,
|
||||
responseType: string
|
||||
}
|
||||
|
||||
const SCOPE = "openid profile email";
|
||||
const RESPONSE_TYPE = "code";
|
||||
|
||||
export function getFrontendAuthConfig(): FrontendAuthConfig {
|
||||
return {
|
||||
student: {
|
||||
authority: getEnvVar(EnvVars.IdpStudentUrl),
|
||||
clientId: getEnvVar(EnvVars.IdpStudentClientId),
|
||||
scope: SCOPE,
|
||||
responseType: RESPONSE_TYPE
|
||||
},
|
||||
teacher: {
|
||||
authority: getEnvVar(EnvVars.IdpTeacherUrl),
|
||||
clientId: getEnvVar(EnvVars.IdpTeacherClientId),
|
||||
scope: SCOPE,
|
||||
responseType: RESPONSE_TYPE
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue