I am building a small application for better understanding security from the ground up and have a question about authentication flow (I believe this would be 2FA):
My question is about systems that dispatch say an email or text message to authenticate the potential user really is a user and how this is handled from the standpoint of a first-time user or someone who is registering with the application.
In systems like this is the potential user's data already saved to the database before the email is dispatched or is it being held as a promise awaiting the response to the email/text and then persisted to our database?
This example is more so 2FA after a user has become registered, but for instance with Zeit.co if I want to login to the now-cli I will be asked for my email and an email is dispatched to the registered account with a randomly generated key. I am shown the key in a prompt upon the dispatch of the email and am prompted to double check the keys match from the prompt to the email before authenticating. Example views below (api token has been revoked already):

Email has been dispatched with the following key for me to verify is a match before authenticating.

Email received and security code matches.

View on page updates and redirects.
No responses yet.