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

fix(login): Disable login button when already logging in #45352

Merged

Conversation

SystemKeeper
Copy link
Contributor

Summary

Fixes "State token does not match" in some cases (e.g. double click on the login button)

How to reproduce:

  • Start a login flow (V1 or V2), e.g. by logging in via the desktop client
  • Enter username and password
  • Click "Log in" and when the button changes to "Logging in" click the button again
  • You're now prompted with a "temporary error".
  • Enter your password
  • See the error "State token does not match"

Before

image

After

image

Checklist

@ChristophWurst
Copy link
Member

To prevent double submit through enter we could adjust LoginForm.vue and ignore form submit while loading=true as well. Apparently this would be possible with a disabled field set: https://stackoverflow.com/questions/3507958/how-can-i-make-an-entire-html-form-readonly

@SystemKeeper
Copy link
Contributor Author

SystemKeeper commented May 16, 2024

Right, I didn’t think of enter. Let me adjust the PR
Edit: let’s disable the button anyway.

@SystemKeeper SystemKeeper marked this pull request as draft May 16, 2024 10:44
@SystemKeeper SystemKeeper marked this pull request as ready for review May 16, 2024 10:45
@SystemKeeper SystemKeeper marked this pull request as draft May 16, 2024 10:48
@SystemKeeper SystemKeeper marked this pull request as ready for review May 16, 2024 11:19
@SystemKeeper
Copy link
Contributor Author

Apparently this would be possible with a disabled field set

I tried that, but then I am unable to login in any way (it always ends up in a temporary error). Therefore I prevented another submit of the form, as we already have a submit handler.

@SystemKeeper SystemKeeper added the 3. to review Waiting for reviews label May 16, 2024
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@juliushaertl juliushaertl force-pushed the fix/noid/prevent-duplicate-click-event-on-login branch from 53f09bd to f6e6d7a Compare June 6, 2024 10:00
@juliushaertl juliushaertl added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 6, 2024
@juliushaertl
Copy link
Member

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@juliushaertl juliushaertl merged commit 1a543d0 into master Jun 6, 2024
104 checks passed
@juliushaertl juliushaertl deleted the fix/noid/prevent-duplicate-click-event-on-login branch June 6, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: authentication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants