Fix OIDC logins in the account switcher failing due to the router ignoring login attempts

The router only lets you visit `/home` or the like if `addAccount` is unset,
but this did not account for `loginToken`. Now, if `loginToken` is set,
you visit the `/login/server` route instead of being redirected to `/home`,
allowing the account switcher to work as intended.
This commit is contained in:
Koen Oostveen committed 2026-05-19 20:54:49 +02:00
1 parent 8fcb3120ed
commit 652e91acda
1 file changed
+1
+1
View File
@@ -119,6 +119,7 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
// Allow reaching the login page with ?addAccount=1 even when already logged in
const url = new URL(request.url);
if (url.searchParams.get('addAccount') === '1') return null;
if (url.searchParams.has('loginToken')) return null;
if (hasStoredSession()) return redirect(getHomePath());
return null;
}}