DWQA QuestionsCategory: ProgramHow does the confirmation link sent to the user's mailbox by the website when registering generate and determine the user?
tcitry asked 1 week ago

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.

2 Answers
Best Answer
Tetranychus pedis answered 1 week ago

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.

Tetranychus pedis replied 1 week ago

Anyway, you understand that the achievement is to validate the process without modifying the database structure and data.

Childe answered 1 week ago

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 asverify/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.