+async function sendVerifyUserEmail (user: UserModel) {
+ const verificationString = await Redis.Instance.setVerifyEmailVerificationString(user.id)
+ const url = CONFIG.WEBSERVER.URL + '/verify-account/email?userId=' + user.id + '&verificationString=' + verificationString
+ await Emailer.Instance.addVerifyEmailJob(user.email, url)
+ return
+}
+
+async function askSendVerifyUserEmail (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const user = res.locals.user as UserModel
+
+ await sendVerifyUserEmail(user)
+
+ return res.status(204).end()
+}
+
+async function verifyUserEmail (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const user = res.locals.user as UserModel
+ user.emailVerified = true
+
+ await user.save()
+
+ return res.status(204).end()
+}
+