For example, I registered a user name on a website, the website sent confirmation links to my mailbox, and after I clicked on my mailbox, my mailbox status was authenticated. How did this process be realized? Ps: For the time being, Django will be used to implement this function.
I like to use a simple, Database-Free approach.
Use a key to encrypt with user ID + timestamp.
When you take it back, uncover it to see if the validity period has passed, and then mark the user as authenticated.
Anyway, you understand that the achievement is to validate the process without modifying the database structure and data.
When registering, a temporary code is generated according to the mailbox (how to generate it at will) and written down together with the mailbox.
Then generate a web address based on the temporary code, such as
verify/xxoowtf。 When the user visits the website, he gets the temporary code parameter and matches it with the database. If the match is successful, he clears the temporary code from the database, indicating that the Email has been validated successfully.