Fix: persist SSO auth token on root route loader (#12784)

### What problem does this PR solve?

This PR fixes SSO/OIDC login persistence after the Vite migration
#12568. Because wrappers are ignored by React Router, the OAuth callback
never stored the auth token in localStorage, causing auth to only work
while ?auth= stayed in the URL. We move that logic into a route loader
and remove the Bearer prefix for the signed token so the backend accepts
it.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Contribution during my time at RAGcon GmbH.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Levi
2026-02-12 03:09:35 +01:00
committed by GitHub
parent 67937a668e
commit 4b50b8c579
2 changed files with 13 additions and 5 deletions

View File

@@ -49,9 +49,7 @@ const storage = {
export const getAuthorization = () => {
const auth = getSearchValue('auth');
const authorization = auth
? 'Bearer ' + auth
: storage.getAuthorization() || '';
const authorization = auth ? auth : storage.getAuthorization() || '';
return authorization;
};