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

Prevent double clicking of the submit button on login #3554

Merged

Conversation

pcorliss
Copy link
Contributor

Overview

Disables the submit button on login to prevent clicking multiple times while waiting for a response from the form submission on login.

What this PR does / why we need it

When connecting to a very slow provider a response can take several seconds, without a visual indicator users click the submit button several times. After multiple clicks when a response is returned it's often a 500 error page within our setup. Better to prevent the user from submitting the form multiple times and indicating that by disabling the button.

We can solve this issue internally by having a custom frontend documented here https://dexidp.io/docs/guides/templates/ but this felt like a good thing to share more widely to help others.

Special notes for your reviewer

If necessary the following can be rewritten inline to avoid loading a unique JS file.

Copy link
Member

@nabokihms nabokihms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the idea looks cool. Just a couple of questions.

web/static/form.js Outdated Show resolved Hide resolved
web/static/form.js Outdated Show resolved Hide resolved
@pcorliss pcorliss force-pushed the UPPI-2578/pkc-prevent-double-clicking branch from e900918 to 8ca20f2 Compare June 6, 2024 14:18
@pcorliss pcorliss requested a review from nabokihms June 11, 2024 18:30
@nabokihms nabokihms merged commit a174846 into dexidp:master Jun 13, 2024
9 checks passed
@nabokihms nabokihms added this to the v2.41.0 milestone Jun 13, 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.

2 participants