CloudClub-uoft / cloud-club-website

Club Website
https://cloudclub.ca
4 stars 4 forks source link

Wu feature email verification - feature implemented, pending testing #82

Closed qingyuan-wu closed 2 years ago

qingyuan-wu commented 2 years ago

Modify logins schema that contains info regarding whether the user is "verified":

DROP TABLE IF EXISTS `logins`;
CREATE TABLE `logins` (
  `id` int NOT NULL AUTO_INCREMENT,
  `first-name` text NOT NULL,
  `last-name` text NOT NULL,
  `email` text NOT NULL,
  `password` text NOT NULL,
  `verified` TINYINT(1) DEFAULT 0,
  PRIMARY KEY (`id`)
); 
qingyuan-wu commented 2 years ago

Add new table email_verification that stores the uuid required to verify new users.

DROP TABLE IF EXISTS `email_verification`;
CREATE TABLE `email_verification` (
  `email` VARCHAR(200) NOT NULL,
  `first-name` text NOT NULL,
  `last-name` text NOT NULL,
  `uuid` text NOT NULL,
  PRIMARY KEY (`email`)
); 
qingyuan-wu commented 2 years ago

I have added the middleware for email verification. This middleware is triggered whenever the user attempts to access the new post page (GET), post a new post (POST), or edit their profile (POST). The user is still able to get their profile, but they will be prompted to verify their email instead of editing it.

Qingyuan

harsimrat99 commented 2 years ago

Hi Qingyuan,

Thank you for making the requested changes and for your work in driving this feature. I will merge this branch and close this PR.

Best, Harsimrat