refactor(db/models): rename generateToken
method to generateJWT
This commit is contained in:
parent
f4ed17a893
commit
ae8d34d84f
@ -75,7 +75,7 @@ export interface IUser extends Document {
|
|||||||
quickMenuConfig: QuickMenuItem[];
|
quickMenuConfig: QuickMenuItem[];
|
||||||
notifyOnReviewReply?: boolean;
|
notifyOnReviewReply?: boolean;
|
||||||
validPassword(password: string): boolean;
|
validPassword(password: string): boolean;
|
||||||
generateToken(jwtSecret: string): string;
|
generateJWT(jwtSecret: string): string;
|
||||||
}
|
}
|
||||||
// type iut = IUser;
|
// type iut = IUser;
|
||||||
interface UModel extends Model<IUser> {
|
interface UModel extends Model<IUser> {
|
||||||
@ -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(
|
let token = jwt.sign(
|
||||||
{ id: this._id, isAdmin: this.profile.isAdmin },
|
{ id: this._id, isAdmin: this.profile.isAdmin },
|
||||||
jwtKey,
|
jwtKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user