mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Initialize JWT Secret before it's used anywhere (#7707)
HELP-394
This commit is contained in:
committed by
GitHub
parent
5aee2b768f
commit
3460eb5eeb
@@ -63,7 +63,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
generatePasswordResetToken(user: User, expiresIn = '20m') {
|
||||
return this.jwtService.signData(
|
||||
return this.jwtService.sign(
|
||||
{ sub: user.id, passwordSha: createPasswordSha(user) },
|
||||
{ expiresIn },
|
||||
);
|
||||
@@ -82,7 +82,7 @@ export class UserService {
|
||||
async resolvePasswordResetToken(token: string): Promise<User | undefined> {
|
||||
let decodedToken: JwtPayload & { passwordSha: string };
|
||||
try {
|
||||
decodedToken = this.jwtService.verifyToken(token);
|
||||
decodedToken = this.jwtService.verify(token);
|
||||
} catch (e) {
|
||||
if (e instanceof TokenExpiredError) {
|
||||
this.logger.debug('Reset password token expired', { token });
|
||||
|
||||
Reference in New Issue
Block a user