You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MFA login fails with "CSRF token validation failed" due to duplicate form submission #3370
CSRF token validation failed. Please refresh the page and try again.
The login returns HTTP 403 with EBADCSRFTOKEN. The password step works; the failure happens on the OTP step. It reproduces on a single dashboard instance, in incognito, with no browser extensions, so it is not the multi-replica / sticky-session scenario from #3015.
Steps to reproduce
Configure a dashboard user with mfa set.
Open the login page, enter username + password, then the one-time password, and submit.
Login fails with "CSRF token validation failed".
Actual Outcome
The OTP step issues twoPOST /login requests. The first authenticates successfully; Passport's req.logIn then calls req.session.regenerate() (session-fixation protection), which destroys the session that holds the CSRF token (csrf-sync stores the token in req.session). The browser cancels that first response and never receives the regenerated session cookie, so the second request lands on the now-destroyed session, finds no CSRF token, and fails validation with 403.
The duplicate submission originates in LoginForm.react.js: the submit control is type="submit" (which natively submits the form) and its onClick also calls this.formRef.current.submit(), producing a second, redundant submission. On the password step both submissions return 302, so it is harmless; only the MFA step exposes it because the first POST regenerates the session.
Expected Outcome
Login with MFA succeeds; the form is submitted exactly once.
Environment
Parse Dashboard version: 9.1.1 (also present on alpha / HEAD)
ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
Activity
parse-github-assistant commentedon Jun 13, 2026
🚀 Thanks for opening this issue!
ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.