Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Prevent double login causing 419 CSRF token mismatch #10465

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Jul 16, 2024

This fixes an issue where some people were seeing 419 errors after logging in.

We found that the reason was typically due to submitting the form twice.

Either by:

  • Clicking the log in button multiple time
  • Using 1Password to auto-fill their credentials, which submits the form, and then the user clicking log in before the redirect happens.

It seems that the first time the form is submitted, you get logged in and your csrf token is updated. Then if you click it a second time, the old token is submitted but no longer matches your current one, resulting in the error.

This PR fixes that issue by disabling the submit button while the form is submitting, preventing you from submitting twice.

This PR gives the same treatment to the reset password form which has the same issue.

@jasonvarga jasonvarga changed the title [5.x] Prevent double login causing 419 [5.x] Prevent double login causing 419 CSRF token mismatch Jul 17, 2024
@jasonvarga jasonvarga merged commit 8ade0d1 into 5.x Jul 17, 2024
19 checks passed
@jasonvarga jasonvarga deleted the prevent-double-login branch July 17, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant