fix: normalize OIDC issuer URL to avoid double slashes
The OIDC issuer URL in .env ends with a trailing slash, which caused the authorize endpoint to have a double slash (//authorize). - Normalize issuer URL by removing trailing slash before appending path - Applied to both LoginPage.tsx and CallbackPage.tsx - Fixes Authentik 'not found' error on login redirect
This commit is contained in:
@@ -35,7 +35,8 @@ export default function CallbackPage() {
|
||||
|
||||
setStatus('Exchanging code for token...')
|
||||
|
||||
const tokenResponse = await fetch(`${OIDC_ISSUER}/token/`, {
|
||||
const issuer = OIDC_ISSUER.endsWith('/') ? OIDC_ISSUER.slice(0, -1) : OIDC_ISSUER
|
||||
const tokenResponse = await fetch(`${issuer}/token/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
|
||||
Reference in New Issue
Block a user