fix(web): preserve ?redirect= through the 2FA hop #45
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/bunyip!45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/preserve-redirect-through-2fa"
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?
When LoginOutcome::TwoFactorRequired fires, the post-verify redirect was
hardcoded to /dashboard. That broke the OIDC return-url for any user who
has 2FA enabled: signing in via /oauth2/authorize -> bunyip-web /login ->
/login/2fa -> /dashboard never bounced back to api.a8n.systems for the
code-exchange. The user lands on bunyip's dashboard instead of mokosh.
Carry the original ?redirect= forward through the 2FA hop:
?redirect=.
plain login_post), redirect_cookies to the result on success, render
error card with redirect preserved on failure.
Adds urlencoding="2" as a tiny dep so we don't hand-roll percent-encoding
for the OIDC URL. The unrelated magic-link 2FA branch at line 363 still
hardcodes /login/2fa - magic link is its own flow with no caller-supplied
redirect today, untouched here.