dexidp / dex

OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors
https://dexidp.io
Apache License 2.0
9.2k stars 1.67k forks source link

Prevent double clicking of the submit button on login #3554

Closed pcorliss closed 3 weeks ago

pcorliss commented 1 month ago

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.