From d23582eb8285704fc083b6b2e1155e7f7700ec5e Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Sat, 16 May 2026 13:36:50 +0000 Subject: [PATCH] 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 --- apps/web/src/pages/CallbackPage.tsx | 3 ++- apps/web/src/pages/LoginPage.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/CallbackPage.tsx b/apps/web/src/pages/CallbackPage.tsx index 5b103fc..0309569 100644 --- a/apps/web/src/pages/CallbackPage.tsx +++ b/apps/web/src/pages/CallbackPage.tsx @@ -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', diff --git a/apps/web/src/pages/LoginPage.tsx b/apps/web/src/pages/LoginPage.tsx index 0f15555..8082560 100644 --- a/apps/web/src/pages/LoginPage.tsx +++ b/apps/web/src/pages/LoginPage.tsx @@ -20,7 +20,8 @@ export default function LoginPage() { code_challenge_method: 'S256', }) - window.location.href = `${OIDC_ISSUER}/authorize?${params.toString()}` + const issuer = OIDC_ISSUER.endsWith('/') ? OIDC_ISSUER.slice(0, -1) : OIDC_ISSUER + window.location.href = `${issuer}/authorize?${params.toString()}` } initiateLogin()