Components for user modification, email validation
This commit is contained in:
parent
01227bb28f
commit
99a3d7ff33
9 changed files with 193 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import EmailValidator from "email-validator";
|
||||
import { Request, Response } from "express";
|
||||
import Validate from "../../../email/templates/Validate";
|
||||
import Users from "../../../models/User";
|
||||
import { LOGGER } from "../../../util/Logger";
|
||||
|
||||
|
|
@ -36,6 +37,9 @@ export default async (req: Request, res: Response) => {
|
|||
const created = new Users({ first, last, email: fmtEmail });
|
||||
created.password = created.hashPassword(password);
|
||||
await created.save();
|
||||
|
||||
await Validate(created);
|
||||
|
||||
return res.status(200).json(created);
|
||||
} catch (ex) {
|
||||
LOGGER.error(ex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue