diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-02-25 03:46:29 -0500 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-02-25 03:46:29 -0500 |
commit | 1932e3488e055689149af67d243933ee9b59d4d9 (patch) | |
tree | 4cedee3c29816f9557c1b0caf3c3661a448f9cad /src/server/authentication/controllers/user.ts | |
parent | 0d36924c90682c57e96c1e7bfd95a3cc10e6c662 (diff) |
minor fixes
Diffstat (limited to 'src/server/authentication/controllers/user.ts')
-rw-r--r-- | src/server/authentication/controllers/user.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/authentication/controllers/user.ts b/src/server/authentication/controllers/user.ts index 19cd09676..772693652 100644 --- a/src/server/authentication/controllers/user.ts +++ b/src/server/authentication/controllers/user.ts @@ -170,14 +170,13 @@ export let postForgot = function (req: Request, res: Response, next: NextFunctio done(null, buffer.toString('hex')); }) }, - function (token: Buffer, done: any) { + function (token: string, done: any) { User.findOne({ email }, function (err, user: UserModel) { if (!user) { // NO ACCOUNT WITH SUBMITTED EMAIL return res.redirect('/forgot'); } - user.passwordResetToken = token.toString('utf8'); - console.log(user.passwordResetToken); + user.passwordResetToken = token; user.passwordResetExpires = new Date(Date.now() + 3600000); // 1 HOUR user.save(function (err: any) { done(null, token, user); |