Skip to content

Client-side validation of OTP field on login form #1152

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

Closed
jn64 opened this issue Feb 28, 2023 · 2 comments · Fixed by #1319
Closed

Client-side validation of OTP field on login form #1152

jn64 opened this issue Feb 28, 2023 · 2 comments · Fixed by #1319
Assignees
Labels
EasyFix Good for newcomers enhancement New feature or request S Small (~5 hours of work) UX User experience

Comments

@jn64
Copy link

jn64 commented Feb 28, 2023

pattern attribute can be set for client-side validation (depending on browser support).

For example pattern="\d{6}" for 6-digit OTPs (I'm not sure what types of OTP are supported by noggin). The form submission will be blocked if the input does not match the pattern.

If the user mis-types the OTP, this saves them from having to re-fill the username and password if they had submitted and failed the server-side validation.

Screenshot showing client-side validation of OTP field in Firefox, preventing submission of wrong OTP:

Screenshot showing client-side validation of OTP field in Firefox

@abompard abompard added enhancement New feature or request EasyFix Good for newcomers S Small (~5 hours of work) UX User experience labels Feb 28, 2023
@abompard
Copy link
Member

Pretty cool, thanks for the detailed issue!

@jn64
Copy link
Author

jn64 commented Feb 28, 2023

Sorry, I must have followed a link to an older commit when I was browsing the repo earlier, because the autocomplete=off is already implemented in dev branch. I will edit the issue to be about the client-side validation only.

@jn64 jn64 changed the title OTP field on login form improvements Cilent-side validation of OTP field on login form Feb 28, 2023
@jn64 jn64 changed the title Cilent-side validation of OTP field on login form Client-side validation of OTP field on login form Feb 28, 2023
@abompard abompard self-assigned this Oct 6, 2023
abompard added a commit to abompard/noggin that referenced this issue Oct 6, 2023
Fixes: fedora-infra#1152
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
abompard added a commit that referenced this issue Oct 13, 2023
Fixes: #1152
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EasyFix Good for newcomers enhancement New feature or request S Small (~5 hours of work) UX User experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants