From ae8d34d84f9bc60011a7ab9a4ecb487f67f52f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 20 Dec 2023 19:56:33 -0500 Subject: [PATCH] refactor(db/models): rename `generateToken` method to `generateJWT` --- models/user.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,