mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 17:11:17 -08:00
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:
1 file changed
+1
@@ -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;
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user