Closed adamkdean closed 1 year ago
To summarise what has been discussed on Discord:
Sign Up Creating an account with have two separate (but similar) flows. 1) Create anonymous account (current flow)
Some notes:
verified: false
flag.verified: true
. The user can log in after this step (if they chose to skip 2FA), so a session should be created.Sign In One the landing page, the same input will be used for attempting a sign in with an account number or an email address. If using an email address, the user will be sent an email with a link that will open a tab with a signed in session (unless 2FA is needed first).
Even if an account was created with an email, if the user notes down the account number (which they can still find in the accounts settings page), they would be able to log in with either or. Same for anonymous accounts; if they add an email they can sign in with it.
Unique Constraints on Emails As is currently the case, any email that has been verified becomes a unique value. That is to say, multiple people can create accounts with the same email (or add to existing accounts) prior to verification. Once one of these accounts is verified, an error will be returned if someone tries to verify the email from a different account. Also, an error will be returned if the email is used to create a new account/added to an existing account.
Dormant Accounts Just like with anonymous accounts, if an account is created and never used/verified, it will remain in the database with no regular clean up job. The are no major implications (at the moment) of having extra accounts sitting in the db other than just some extra data.
We may decide to do a clean up at some point, but this needs to be done with careful consideration so we don't accidentally delete accounts that are in use.
If an account is created with an email address but never verified, a new account can still be created with the same email address with no issue (see unique constraints above). This prevents people creating unverified accounts in bad faith with other people's email addresses, as until verified it means nothing.
UI Changes There will be some UI changes needed as a result in addition to the obvious (changes to sign in flow).
We want to add a new feature to the account system: signing up/in with emails. ✉️
This will allow us to appeal to a larger range of (potential) customers.
The sign in interface will allow an email or account number to be input. When it's an email, upon submission, the system will need to dispatch an email with a "magic link" sign in link. Account number sign ins will remain unchanged.
For sign up, a similar thing will occur. Behind the scenes, a regular account will be generated, but will have the email linked to it (recovery email) and then an email will be dispatched. Clicking the link will both verify the recovery email and sign in the user.
Any questions, let me know.