Repository navigation
Ask for the second factor instead of looping between / and /login - #10
Merged
Merged
Conversation
With the password accepted but the second factor still pending, the session is aal1. Opening / (or any return_to) then looped until the browser gave up with ERR_TOO_MANY_REDIRECTS: / toSession is 403 (highest_available wants aal2) → /login /login no flow → /self-service/login/browser, without aal=aal2 Kratos a session exists → "already logged in" → return_to, by default / It happened whenever someone left the 2FA screen, reopened the portal or an app, or the 2FA flow expired (Kratos sends the browser to /login?flow=<id>, so a restarted flow had no aal=aal2 either). A fresh login flow now asks Kratos for aal2 when whoami answers session_aal2_required. The e2e test reproduces the loop on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
With the password accepted but the second factor pending (an aal1 session), opening
/or anyreturn_tolooped until the browser gave up withERR_TOO_MANY_REDIRECTS:/:toSessionis 403 (highest_availablewants aal2), so it redirects to/login./loginwithout a flow goes to/self-service/login/browserwithoutaal=aal2.return_to(by default/).A fresh login flow now asks for
aal=aal2when whoami answerssession_aal2_required. The e2e test opens/and/loginfrom the 2FA screen. It fails withERR_TOO_MANY_REDIRECTSon the old code; with the fix all 16 e2e tests pass locally.🤖 Generated with Claude Code