fix(auth): resolve OIDC logout URL before clearing auth state - #191
Merged
Conversation
PKizzle
force-pushed
the
fix/oidc-federated-logout-redirect
branch
from
July 31, 2026 20:42
de8ec14 to
0e45c2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
logoutWithOidcRedirect()calledlogout()before awaiting the config load, then setwindow.location.hrefto the RP-logout endpoint. Clearing auth state flipsisAuthenticatedtofalse, so during theawait import()/loadConfig()gapDashboardAuthGuardfiresrouter.replace("/auth/login/?unauthorized=true"). That redirect preempts the not-yet-assignedwindow.location.href, so the browser never reaches/rustfs/admin/v3/oidc/logout, the one-time logout token is never consumed, and the IdP session is left active.This resolves the logout URL first and only then clears state and navigates, in the same synchronous step, so nothing can
awaitbetween the state change and the redirect. Behaviour is otherwise unchanged: local state is still always cleared, and the no-session / error paths still returnfalse.Type of Change
Testing
Added
tests/lib/oidc-logout-source.test.jsto lock the ordering (destination built beforelogout(); state not cleared ahead of the config await). Reproduced the original race and verified the fix against Authentik as the IdP: logout now reaches/rustfs/admin/v3/oidc/logout, which redirects to the providerend_session_endpointand terminates the session.Checklist
Related Issues
Closes #190