diff --git a/models/user.ts b/models/user.ts index 71c4c1e..b53c548 100644 --- a/models/user.ts +++ b/models/user.ts @@ -75,7 +75,7 @@ export interface IUser extends Document { quickMenuConfig: QuickMenuItem[]; notifyOnReviewReply?: boolean; validPassword(password: string): boolean; - generateToken(jwtSecret: string): string; + generateJWT(jwtSecret: string): string; } // type iut = IUser; interface UModel extends Model { @@ -281,7 +281,7 @@ UserSchema.methods.validPassword = function (password: string): boolean { ); }; -UserSchema.methods.generateToken = function (jwtKey: string): string { +UserSchema.methods.generateJWT = function (jwtKey: string): string { let token = jwt.sign( { id: this._id, isAdmin: this.profile.isAdmin }, jwtKey,