fix(oidc): strip trailing slash from redirect URI to match Authentik strict mode
This commit is contained in:
@@ -77,7 +77,7 @@ export async function startLogin(): Promise<void> {
|
||||
sessionStorage.setItem(PKCE_KEY, codeVerifier)
|
||||
sessionStorage.setItem(STATE_KEY, oidcState)
|
||||
|
||||
const redirectURI = location.origin + location.pathname
|
||||
const redirectURI = (location.origin + location.pathname).replace(/\/$/, '')
|
||||
|
||||
const params = new URLSearchParams({
|
||||
response_type: 'code',
|
||||
@@ -103,7 +103,7 @@ export async function handleCallback(code: string, returnedState: string): Promi
|
||||
const cfg = state.config ?? await fetchConfig()
|
||||
if (!cfg) return false
|
||||
|
||||
const redirectURI = location.origin + location.pathname
|
||||
const redirectURI = (location.origin + location.pathname).replace(/\/$/, '')
|
||||
|
||||
try {
|
||||
const resp = await fetch(apiBase('/api/v1/auth/oidc-token'), {
|
||||
|
||||
Reference in New Issue
Block a user