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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@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
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants