Components for user modification, email validation

This commit is contained in:
oitsjustjose 2022-04-14 21:03:37 -05:00
commit 99a3d7ff33
9 changed files with 193 additions and 3 deletions

View file

@ -21,6 +21,13 @@ export default async (req: Request, res: Response) => {
.json({ error: "Email address is not registered." });
}
if (!user.isEmailValidated) {
return res.status(403).json({
error:
"This email address has not yet been validated. Please check your email.",
});
}
if (!user.validPassword(req.body.password)) {
return res
.status(404)