Skip to content

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
@juliusknorr juliusknorr force-pushed the fix/noid/prevent-duplicate-click-event-on-login branch from 53f09bd to f6e6d7a Compare June 6, 2024 10:00
@juliusknorr juliusknorr 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
@juliusknorr
Copy link
Member

/compile

Signed-off-by: nextcloud-command <[email protected]>
@juliusknorr juliusknorr enabled auto-merge June 6, 2024 16:39
@juliusknorr juliusknorr merged commit 1a543d0 into master Jun 6, 2024
@juliusknorr juliusknorr deleted the fix/noid/prevent-duplicate-click-event-on-login branch June 6, 2024 17:00
@blizzz blizzz mentioned this pull request Jul 24, 2024
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.

7 participants