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

Passwordless | Update create account flows for existing users #3040

Merged
merged 5 commits into from
Jan 27, 2025

Conversation

coldlink
Copy link
Member

@coldlink coldlink commented Jan 23, 2025

What does this change?

Currently when a reader who already has a Guardian account goes through the "create account" flow (/register/email), they will not be sent a passcode, but instead an email saying they already have a Guardian account and to sign in or reset their password, and shown a generic "Check your inbox" page. This differs from how it works for new users, who get a passcode after entering their email on the create account page.

This isn't ideal. Firstly the user experience is different and unexpected, especially as we use passcodes in all other scenarios now (sign in + reset password). It also a small security/user data risk, specifically for username enumeration, where an attacker can find out if a given account exists depending on which page the attacker sees after entering their email.

This PR fixes this behaviour by making sure we use passcodes for all users who go through the create account flow. For new users the behaviour is exactly the same. For existing users we now send them a passcode that allows them to sign in, which piggybacks of the work done in #2942 for sign in with passcodes.

We modify the sign in with passcode controllers to allow us to display the correct email sent page (/register/email-sent) and a different page after verifying their code (confirmationPagePath), other than that the logic/behaviour is the same as for sign in with passcodes.

Existing users will see a new page after going through the create account flow, specifically the WelcomeExisting page on the /welcome/existing route, which lets the user know that they already have a Guardian account, they've now signed in, and they can return to the Guardian or manage their account.

Finally a whole lotta tests were added and updated in order to take into account the new create account flow for existing users.

WelcomeExisting

`WelcomeExisting` page

Screen Shot 2025-01-23 at 14 37 09

Demo

New User Existing User - Old behaviour Existing User - New behaviour
Screen.Recording.2025-01-23.at.14.42.51.mov
Screen.Recording.2025-01-23.at.14.44.34.mov
Screen.Recording.2025-01-23.at.14.49.26.mov

Tested

  • DEV
  • CODE

@coldlink coldlink added the passwordless PRs/Issues related to passwordless/passcode functionality label Jan 23, 2025
@coldlink coldlink requested a review from a team as a code owner January 23, 2025 14:21
@coldlink coldlink force-pushed the mm/passcode-create-account-full branch from c63c101 to 7573985 Compare January 23, 2025 14:32
@coldlink coldlink requested review from a team and removed request for a team January 23, 2025 14:32
@coldlink coldlink force-pushed the mm/passcode-create-account-full branch from 7573985 to 5a719dc Compare January 27, 2025 10:16
@coldlink coldlink requested review from a team and removed request for a team January 27, 2025 10:16
@coldlink coldlink enabled auto-merge January 27, 2025 10:51
@coldlink coldlink merged commit 7148500 into main Jan 27, 2025
21 checks passed
@coldlink coldlink deleted the mm/passcode-create-account-full branch January 27, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
passwordless PRs/Issues related to passwordless/passcode functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants