mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-05 01:58:50 +01:00
fix: change generateToken method to a static method on userSchema
This commit is contained in:
parent
85d0688f38
commit
0cb5ed4063
1 changed files with 1 additions and 1 deletions
|
|
@ -309,7 +309,7 @@ userSchema.statics.deleteUserById = async function (userId: string) {
|
|||
* @param {MongoUser} user - The user for whom the token is being generated.
|
||||
* @returns {Promise<string>} A promise that resolves to a JWT token.
|
||||
*/
|
||||
userSchema.methods.generateToken = async function (user: IUser): Promise<string> {
|
||||
userSchema.statics.generateToken = async function (user: IUser): Promise<string> {
|
||||
if (!user) {
|
||||
throw new Error('No user provided');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue