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

Show error message on Google sign-in failure #9018

Conversation

jimchamp
Copy link
Collaborator

@jimchamp jimchamp commented Apr 3, 2024

Closes #9019

Shows error message on Google sign-in failures.

Technical

If the response from the /account/login.json call is ok, we immediately redirect to the patron's account page (this is BAU). Otherwise, we display the localized error message in a newly created .note div.

The account/login.json handler has been updated to return a JSON string containing the error short code and the localized error message when a BadRequest is raised. Previously, only the error short code was returned in these cases (it wasn't even JSON encoded...).

Testing

Recommend testing this before #8980 is deployed and tested.

  1. Delete an existing IA account that was created using Google sign-in.
  2. Re-create the IA account using the same Google account.
  3. Attempt to log into OL using Google sign-in. If you see an error like the one in the screenshot, below, this code is working as expected.

Screenshot

image

Stakeholders

@mekarpeles

@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 15.93%. Comparing base (44e250f) to head (38c09fe).

Files Patch % Lines
...ary/plugins/openlibrary/js/ia_thirdparty_logins.js 0.00% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9018      +/-   ##
==========================================
- Coverage   15.95%   15.93%   -0.03%     
==========================================
  Files          89       89              
  Lines        4712     4720       +8     
  Branches      822      823       +1     
==========================================
  Hits          752      752              
- Misses       3450     3457       +7     
- Partials      510      511       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jimchamp jimchamp force-pushed the bug/display-error-on-auth-failure branch from 48db825 to 38c09fe Compare April 3, 2024 00:16
@jimchamp jimchamp added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 3, 2024
@jimchamp jimchamp changed the title [WIP] Show error message on Google sign-in failure Show error message on Google sign-in failure Apr 3, 2024
@jimchamp jimchamp marked this pull request as ready for review April 3, 2024 00:31
Copy link
Member

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

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

lgtm

@mekarpeles mekarpeles merged commit f834705 into internetarchive:master Apr 4, 2024
4 checks passed
@jimchamp jimchamp deleted the bug/display-error-on-auth-failure branch April 24, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message is not displayed on Google sign-in failure
3 participants