guardian / gateway

🕵️🆔👤The platform for authentication at (profile.)theguardian.com
https://profile.theguardian.com
12 stars 1 forks source link

Passwordless | Update `PasswordUsed` page component + add routes #2866

Closed coldlink closed 2 months ago

coldlink commented 2 months ago

What does this change?

A reader could potentially press back in their browser after using their passcode, we handle this by showing the PasscodeUsed page component instead of an error occuring.

The PasscodeUsed page component was very much specific for the create account flow, even linking to /welcome/password when the CTA was clicked.

This PR updates this so that the component can be modified depending on the current flow, so for reset password flows we show a different set of copy instead.

We may need to update this further when we come to add sign in with passcodes, but if we need it then we'll update closer to the time.

We also add /reset-password/password and /set-password/password to the valid routes array, as the PasswordUsed component now expects them when we do href={buildUrlWithQueryParams(``${path}/password``, {}, queryParams)} and they'll be needed for (re)set password with passcodes anyway, the first of is being implemented in https://github.com/guardian/gateway/pull/2852

Create Account (/welcome) (Re)set Password (/(re)set/password)
60929d168594f80039336501-qfmubviewn chromatic com_iframe html_args= globals=viewport_mobile id=pages-passcodeused--create-account-passcode-used viewMode=story(iPhone SE) 60929d168594f80039336501-qfmubviewn chromatic com_iframe html_args= globals=viewport_mobile id=pages-passcodeused--reset-password-passcode-used viewMode=story(iPhone SE)