aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/authentication')
-rw-r--r--src/server/authentication/AuthenticationManager.ts2
-rw-r--r--src/server/authentication/DashUserModel.ts10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/server/authentication/AuthenticationManager.ts b/src/server/authentication/AuthenticationManager.ts
index 9c1525df0..b5d1dba28 100644
--- a/src/server/authentication/AuthenticationManager.ts
+++ b/src/server/authentication/AuthenticationManager.ts
@@ -6,7 +6,7 @@ import './Passport';
import * as async from 'async';
import * as nodemailer from 'nodemailer';
import * as c from 'crypto';
-import { emptyFunction, Utils } from '../../Utils';
+import { emptyFunction, Utils } from '../../ClientUtils';
import { MailOptions } from 'nodemailer/lib/stream-transport';
import { check, validationResult } from 'express-validator';
diff --git a/src/server/authentication/DashUserModel.ts b/src/server/authentication/DashUserModel.ts
index dbb7a79ed..3bc21ecb6 100644
--- a/src/server/authentication/DashUserModel.ts
+++ b/src/server/authentication/DashUserModel.ts
@@ -1,9 +1,8 @@
-//@ts-ignore
import * as bcrypt from 'bcrypt-nodejs';
-//@ts-ignore
import * as mongoose from 'mongoose';
import { Utils } from '../../Utils';
+type comparePasswordFunction = (candidatePassword: string, cb: (err: any, isMatch: any) => void) => void;
export type DashUserModel = mongoose.Document & {
email: String;
password: string;
@@ -26,8 +25,6 @@ export type DashUserModel = mongoose.Document & {
comparePassword: comparePasswordFunction;
};
-type comparePasswordFunction = (candidatePassword: string, cb: (err: any, isMatch: any) => void) => void;
-
export type AuthToken = {
accessToken: string;
kind: string;
@@ -75,16 +72,19 @@ userSchema.pre('save', function save(next) {
bcrypt.hash(
user.password,
salt,
- () => void {},
+ () => {},
(err: mongoose.Error, hash: string) => {
if (err) {
return next(err);
}
user.password = hash;
next();
+ return undefined;
}
);
+ return undefined;
});
+ return undefined;
});
const comparePassword: comparePasswordFunction = function (this: DashUserModel, candidatePassword, cb) {