Sends verification email upon set and update email

- nits
This commit is contained in:
Florent Vilmart
2016-02-27 15:24:45 -05:00
parent 91d9724182
commit 3ecaa0aa4b
9 changed files with 195 additions and 55 deletions

View File

@@ -27,17 +27,17 @@ export class UsersRouter extends ClassesRouter {
req.body = data;
req.params.className = '_User';
req.config.userController.setEmailVerifyToken(req.body);
//req.config.userController.setEmailVerifyToken(req.body);
let p = super.handleCreate(req);
return super.handleCreate(req);
if (req.config.verifyUserEmails) {
// Send email as fire-and-forget once the user makes it into the DB.
p.then(() => {
req.config.userController.sendVerificationEmail(req.body);
});
}
return p;
// if (req.config.verifyUserEmails) {
// // Send email as fire-and-forget once the user makes it into the DB.
// p.then(() => {
// req.config.userController.sendVerificationEmail(req.body);
// });
// }
// return p;
}
handleUpdate(req) {