Repository navigation
Panels: keep the two-factor step on the panel after a password sign-in - #911
Open
KrzysztofPajak wants to merge 2 commits into
Open
KrzysztofPajak wants to merge 2 commits into
KrzysztofPajak wants to merge 2 commits into
Conversation
A panel password sign-in that needs a second factor stored the storefront's session key and redirected to the storefront's two-factor page, so the code was entered on the storefront and the user ended up there; the panels' own two-factor action read a key nobody set. The panel now keeps its own key and sends the user to its own TwoFactorAuthorization action (Admin, Store and Vendor).
…ly Index parameters
KrzysztofPajak
force-pushed
the
fix/panel-two-factor-session
branch
from
October 14, 2026 16:21
a9c018e to
6b5cc3a
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.
Resolves: no issue (found while reviewing the provider-only sign-in mode, #907-#910)
Type: bugfix
Issue
A password sign-in on the Admin, Store or Vendor panel that needs a second factor left the panel:
BaseLoginController.Indexstored the storefront's session keyRequiresTwoFactorand redirected to the storefront'sTwoFactorAuthorizationroute.TwoFactorAuthorizationactions (GET and POST) readAdminRequiresTwoFactor, which nothing set, so the panel two-factor views were unreachable.To reproduce on
develop: enable two-factor authentication in the customer settings, enable it for an administrator, sign in at/admin/loginwith the password. The browser lands on/twofactorauthorizationof the storefront, and after the code on the storefront home page.Solution
TwoFactorSessionKey, the existingAdminRequiresTwoFactorvalue) and redirects to its ownLogin/TwoFactorAuthorizationaction in the current area (/admin/...,/store/...,/vendor/...).AdminIndex,StoreIndex,VendorIndex), as after a password sign-in without a second factor.LoginControllerTwoFactorTests(password step → panel second step, form shown, valid code signs in to the panel, wrong code does not, no password step → panel login).Verified end to end on a running copy with a two-factor (app verification) administrator:
/admin/login→/Admin/Login/TwoFactorAuthorization; a wrong code stays on the form; a valid TOTP code opens the dashboard.Breaking changes
None. The storefront's two-factor flow is unchanged.