What is the best email confirmation flow for user and for app?
Some variants:
a) The most simple variant, but not the best.
- User send signup form.
- On backend I send link with random hash to users email. In parallel I save this user to db with the
active:false
,hash: hash
fields. - user click link
-
on backend I check link for hash, try to find user with hash. If user found in db, I change
active
totrue
.Flaw: What if email isn't correct or error happened during send? How I can handle it? I can't
b) We can handle all errors and display it to user, but very slow variant
- User send signup form.
- On backend the first of all I save this user to db, then I send link with random hash to users email and if it was sent correctly( no errors) only then, I send response.
- if error happens, I send error response to client, so he know that letter didn't send.
-
probably, I need to delete this user from db
Flaw: Process of registration is really slow. It takes about 20 seconds
c) The best variant, I think
- User send signup form.
- On backend I save the user to db.
- If no errors, I send response to user. In parralell send link with random hash to users email.
-
user get response, if no errors , redirected to page e.g.
/last-step
with textcheck your email...
Also on this page I'll show link, which will allow to send email confirmation again (e.g. every 3 mins)Question: How I can recongize on backend from whom this link was clicked? Where to store temporary info about this user on client?
via WhatIsHTML
No comments:
Post a Comment