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 registration errors from xauthn #10402

Merged
merged 5 commits into from
Jan 30, 2025
Merged

Conversation

mekarpeles
Copy link
Member

@mekarpeles mekarpeles commented Jan 29, 2025

Closes #10035
Closes #10045

The errors in get_login_error need to be updated to include bad_email, bad_password

https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L64-L98

@jimchamp can you also investigate whether we may be able to add errors using the add_flash_message (some are currently hidden on the page) as per #10045 ?

Technical

Testing

Screenshot

Stakeholders

jimchamp and others added 3 commits January 29, 2025 14:12
Adds new error messages that correspond to `xauthn` request failures:
- `bad_password`
- `bad_email`

Also adds a catch-all response that will help surface other `xauthn` failures.
@jimchamp
Copy link
Collaborator

get_login_error now returns new values:

Error Code Error Message
bad_password Password requirements not met.
bad_email Email provider not recognized.
Default "catch-all" case Request failed with error code: ${error_code}

Here are screenshots from my local environment:
account_login
Account login page with bad_password message.

account_create
Account sign-up page with `bad_email message.

Important to note:
If an error occurs during a Google sign-in attempt, a flash message is not displayed. I recommend that we add this in a separate PR, in order to expedite a solution for our most widely encountered account creation issues.
#10404 could also be addressed in this separate PR.

@jimchamp jimchamp marked this pull request as ready for review January 30, 2025 01:09
@mekarpeles
Copy link
Member Author

image
Screenshot 2025-01-30 at 8 39 01 AM

@mekarpeles
Copy link
Member Author

Tested also w/ reasonable credentials

@mekarpeles mekarpeles merged commit 2bf820e into master Jan 30, 2025
7 checks passed
@mekarpeles mekarpeles deleted the fix-registration-errors branch January 30, 2025 16:40
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.

Password error message unstyled Registration issues
2 participants