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

Display error message when Google sign-in fails during account registration #10436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimchamp
Copy link
Collaborator

@jimchamp jimchamp commented Feb 11, 2025

Closes #10404

Updates code such that an error message is displayed whenever a Google sign-in attempt fails during account registration.

Technical

The client-side third-party authentication code handles errors by displaying an error message in a new div, which is attached to the DOM relative to an element with id register.

.then((error) => {
const loginForm = document.querySelector('#register')
const errorDiv = document.createElement('div')
errorDiv.classList.add('note')
errorDiv.textContent = error.errorDisplayString
loginForm.insertAdjacentElement('afterbegin', errorDiv)
})

Potential Follow-up Items

It might be nice to use a single template for the login and sign-up pages. The existing templates for each are largely identical, and combining them would give us an opportunity to clean up some of the confusing class and id names. For example:

Class name on login page is ol-page-signup

<div class="ol-page-signup">

ID on login form is register

<form id="register" class="login olform" name="login" method="post" data-i18n="$json_encode(i18n_strings)">

Testing

Screenshot

Stakeholders

Adding `id` `register` to the sign-up form ensures that an error
message is displayed whenever Google authentication fails.
@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label Feb 11, 2025
@jimchamp jimchamp marked this pull request as draft February 11, 2025 16:42
@jimchamp jimchamp marked this pull request as ready for review February 11, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 Important, as time permits. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error message is displayed when Google sign-in fails on the registration page
1 participant