refactor(editor): Extract @n8n/i18n package for internationalization (no-changelog) (#15466)

This commit is contained in:
Alex Grozav
2025-05-30 11:44:33 +02:00
committed by GitHub
parent bbe2b12bf2
commit e704077864
408 changed files with 1002 additions and 767 deletions

View File

@@ -5,6 +5,7 @@ import { Service } from '@n8n/di';
import { createHash } from 'crypto';
import type { NextFunction, Response } from 'express';
import { JsonWebTokenError, TokenExpiredError } from 'jsonwebtoken';
import type { StringValue as TimeUnitValue } from 'ms';
import { Logger } from 'n8n-core';
import config from '@/config';
@@ -180,7 +181,7 @@ export class AuthService {
return user;
}
generatePasswordResetToken(user: User, expiresIn = '20m') {
generatePasswordResetToken(user: User, expiresIn: TimeUnitValue = '20m') {
const payload: PasswordResetToken = { sub: user.id, hash: this.createJWTHash(user) };
return this.jwtService.sign(payload, { expiresIn });
}