aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/authentication')
-rw-r--r--src/server/authentication/AuthenticationManager.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/authentication/AuthenticationManager.ts b/src/server/authentication/AuthenticationManager.ts
index 52d876e95..74d8d2523 100644
--- a/src/server/authentication/AuthenticationManager.ts
+++ b/src/server/authentication/AuthenticationManager.ts
@@ -3,10 +3,9 @@ import { Request, Response, NextFunction } from 'express';
import * as passport from 'passport';
import { IVerifyOptions } from 'passport-local';
import './Passport';
-import flash = require('express-flash');
import * as async from 'async';
import * as nodemailer from 'nodemailer';
-import c = require('crypto');
+import * as c from 'crypto';
import { emptyFunction, Utils } from '../../Utils';
import { MailOptions } from 'nodemailer/lib/stream-transport';
@@ -62,7 +61,7 @@ export let postSignup = (req: Request, res: Response, next: NextFunction) => {
if (existingUser) {
return res.redirect('/login');
}
- user.save((err: any) => {
+ user.save().then(undefined, (err: any) => {
if (err) {
return next(err);
}
@@ -187,7 +186,7 @@ export let postForgot = function (req: Request, res: Response, next: NextFunctio
}
user.passwordResetToken = token;
user.passwordResetExpires = new Date(Date.now() + 3600000); // 1 HOUR
- user.save(function (err: any) {
+ user.save().then(undefined, (err: any) => {
done(null, token, user);
});
});
@@ -259,7 +258,7 @@ export let postReset = function (req: Request, res: Response) {
user.passwordResetToken = undefined;
user.passwordResetExpires = undefined;
- user.save(function (err) {
+ user.save().then(undefined, (err:any) => {
if (err) {
res.redirect('/login');
return;