19 lines
645 B
TypeScript
19 lines
645 B
TypeScript
/**
|
|
* URLs de l'interface utilisateur Authentik, dérivées de l'issuer OIDC.
|
|
* Issuer attendu : `https://host/auth/application/o/<slug>/` → base `https://host/auth`.
|
|
*/
|
|
|
|
const OIDC_ISSUER = process.env.NEXT_PUBLIC_OIDC_ISSUER ?? ""
|
|
|
|
function authentikBaseUrl(): string | null {
|
|
const idx = OIDC_ISSUER.indexOf("/application/")
|
|
if (idx === -1) return null
|
|
return OIDC_ISSUER.slice(0, idx)
|
|
}
|
|
|
|
/** Page « Paramètres » du portail utilisateur Authentik (mot de passe, MFA, sessions). */
|
|
export function authentikUserSettingsUrl(): string | null {
|
|
const base = authentikBaseUrl()
|
|
return base ? `${base}/if/user/#/settings` : null
|
|
}
|