Skip to content

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented Feb 3, 2025

πŸ—’οΈ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

πŸ“£ Summary

Do not allow SSO users to register with a different email then the one provided by the server.

πŸ“– Description

Make the email field readonly when creating an account with SSO.

πŸ’­ Notes

This was originally a setting, but we've decided we want the field to always be read-only. In addition to the UI change, this PR also adds a validator on the email field to make sure that no one can register with a different email via a clever POST request. The error message will require translation.
This should also fix TASK-1493.

πŸ‘€ Preview steps

Bug template:

  1. ℹ️ Enable Kobo Google Apps SSO
  2. On the login page, click Create an account -> Register with SSO -> Log In
  3. Sign in to your Google account
  4. πŸ”΄ [on main] Change the email field in the registration form and click 'Register and Save'
  5. πŸ”΄ [on main] Go to Account Settings -> Security. Under the email address you'll see "Check your email <new_email>. A verification link has been sent to confirm your ownership. Once confirmed, this address will replace <correct_email>"
  6. 🟒 [on PR] The email field is read-only

@rgraber rgraber changed the title fixup!: well it technically works fix: only allow SSO email when registering Feb 3, 2025
@rgraber rgraber changed the title fix: only allow SSO email when registering fix(SSO): only allow SSO email when registering Feb 3, 2025
@rgraber rgraber changed the title fix(SSO): only allow SSO email when registering fix(SSO): only allow SSO email when registering TASK-1493 Feb 3, 2025
@RuthShryock RuthShryock self-requested a review February 3, 2025 20:49
@rgraber rgraber marked this pull request as ready for review February 3, 2025 20:51
@rgraber rgraber removed request for jnm and noliveleger February 3, 2025 20:52
Copy link
Member

@RuthShryock RuthShryock left a comment

Choose a reason for hiding this comment

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

LGTM!

@rgraber rgraber merged commit b7e7987 into main Feb 4, 2025
4 checks passed
@rgraber rgraber deleted the rsgraber/TASK-1493-inconsistent-sso branch February 4, 2025 12:58
noliveleger pushed a commit that referenced this pull request Apr 4, 2025
### πŸ“£ Summary
Do not allow SSO users to register with a different email then the one
provided by the server.


### πŸ“– Description
Make the `email` field readonly when creating an account with SSO.


### πŸ’­ Notes
This was originally a setting, but we've decided we want the field to
always be read-only. In addition to the UI change, this PR also adds a
validator on the email field to make sure that no one can register with
a different email via a clever POST request. The error message will
require translation.
This should also fix TASK-1493.

### πŸ‘€ Preview steps

Bug template:
1. ℹ️ Enable Kobo Google Apps SSO
2. On the login page, click `Create an account` -> `Register with SSO`
-> `Log In`
3. Sign in to your Google account
4. πŸ”΄ [on main] Change the email field in the registration form and click
'Register and Save'
5. πŸ”΄ [on main] Go to Account Settings -> Security. Under the
email address you'll see "Check your email <new_email>. A verification
link has been sent to confirm your ownership. Once confirmed, this
address will replace <correct_email>"
6. 🟒 [on PR] The email field is read-only
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.

2 participants