) Code language: SQL (Structured Query Language) ( sql ) Updated_at datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() Second, create the users table with the new columns active, activation_code, activation_at, activation_expiry: CREATE TABLE usersĬreated_at timestamp NOT NULL DEFAULT current_timestamp(), If they match, mark the user record as active and redirect to the login page.įirst, drop the users table from the auth database: DROP TABLE users Code language: SQL (Structured Query Language) ( sql ) Otherwise, match the activation code with the hash of the activation code stored in the database.If a user record exists and the activation code is expired, delete the user record from the database and redirect to the registration form.If no user record exists, redirect to the registration form. Find the inactive user with the email address.Sanitize and validate the email and activation code.When users click the activation link in the email, you need to perform the following steps: If users have not activated account, they will not be able to log in. Hashing the activation code ensures that only the user who owns the email address can activate the account, not anyone else, even the admin, who can access the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |