fix(auth): terminal error page on rejected OIDC login (LINKS-11) #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/oidc-rejected-login-terminal-page-LINKS-11"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the infinite login redirect loop in
rusty-links-saaswhen the OIDC IdP rejects an authenticated user (e.g. the email-verified gate fails). Resolves LINKS-11.Previously the
/oauth2/callbackhandler redirected a rejected login to/login?error=access_denied&error_description=..., but the saas/loginpage then unconditionally redirected the browser to/oauth2/login. That restarted the authorize round-trip against the IdP's still-valid SSO session, which failed again immediately, looping forever between/login,/oauth2/login, the IdP authorize endpoint, and/oauth2/callback. The user never saw the rejection reason.Change
The saas
Logincomponent now inspects the query string on mount. When anerrorparameter is present it renders a terminal error card showingerror_descriptionand does NOT auto-redirect, breaking the loop. With noerrorparameter the page behaves exactly as before and starts the OIDC flow. The detection signal staysNoneon SSR and the initial WASM render so hydration reconciles identically before the effect runs. Adds theUrlSearchParamsandLocationweb-sys features for query parsing.Retrying requires an explicit user action: a "Try again" link to
/oauth2/login, or "Sign in with a different account" which routes through/oauth2/logoutto clear the local session and terminate the reused IdP SSO session that fuels the loop.The IdP-side account gate is tracked separately in A8N-63; this PR is the client-robustness fix that holds regardless of account state.
Acceptance criteria
access_denied(or an unverified/rejected identity) renders a terminal page showingerror_description, with no automatic redirect back to the IdP authorize endpoint./logindoes not auto-redirect to/oauth2/loginwhen anerrorparameter is present; the/login<->/oauth2/logincycle is broken.error-param branch never callsset_href).Testing
cargo check --no-default-features --features web,saas --target wasm32-unknown-unknown(clean)cargo check --no-default-features --features saas,server(lib compiles; the only error is thedx-generatedassets/tailwind.cssbeing absent in a bare checkout, unrelated to this change)cargo fmt --check,cargo clippy(no new findings)🤖 Generated with Claude Code