[6.x] Stop auto-logging in users after password reset#14454
Merged
jasonvarga merged 2 commits into6.xfrom Apr 7, 2026
Merged
Conversation
Instead of logging users in after a password reset, redirect them to the login page (CP) or the redirect path (front-end) unauthenticated. This avoids needing special handling for 2FA and passkey-enforced login. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
…rd reset Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
$this->guard()->login($user)call fromResetsPasswords::resetPassword()so users are no longer automatically logged in after resetting their password.redirectPath()in the CPResetPasswordControllerto redirect to the CP login page.statusflash handling toHandleInertiaRequestsso the "password has been reset" message displays as a toast on the CP login page.window.location.hrefreload inReset.vue'sonSuccesscallback that was causing a double page load (wiping the flash message). This was necessary before because the user would get logged in and we needed a full reload when entering the control panel.redirectPath()(from the form'sredirectparameter, or site root) unauthenticated.This avoids needing special handling for 2FA and passkey-enforced login — the user just logs in normally after resetting their password, and auth checks (2FA, passkeys) happen naturally through the login flow.
Replaces #14449
Test plan
tests/Auth/ResetPasswordTest.phpcovering:allow_password_login_with_passkey=falseget the same behavior🤖 Generated with Claude Code