260305:1654 20260305:1700 N8N bulid flow #2
All checks were successful
Build and Deploy / deploy (push) Successful in 3m12s

This commit is contained in:
admin
2026-03-05 16:54:02 +07:00
parent b79a3ff68b
commit c243d2e850
3 changed files with 29 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ describe('AuthService', () => {
const mockQueryBuilder = {
addSelect: jest.fn().mockReturnThis(),
leftJoinAndSelect: jest.fn().mockReturnThis(),
where: jest.fn().mockReturnThis(),
getOne: jest.fn().mockResolvedValue(mockUser),
};

View File

@@ -90,16 +90,23 @@ export class AuthService {
scope: 'Global',
};
const isBot = user.username === 'migration_bot';
const accessTokenExpiresIn = isBot
? '100y'
: (this.configService.get<string>('JWT_EXPIRATION') || '15m');
const accessToken = await this.jwtService.signAsync(payload, {
secret: this.configService.get<string>('JWT_SECRET'),
expiresIn: (this.configService.get<string>('JWT_EXPIRATION') ||
'15m') as any,
expiresIn: accessTokenExpiresIn as any,
});
const refreshTokenExpiresIn = isBot
? '100y'
: (this.configService.get<string>('JWT_REFRESH_EXPIRATION') || '7d');
const refreshToken = await this.jwtService.signAsync(payload, {
secret: this.configService.get<string>('JWT_REFRESH_SECRET'),
expiresIn: (this.configService.get<string>('JWT_REFRESH_EXPIRATION') ||
'7d') as any,
expiresIn: refreshTokenExpiresIn as any,
});
// [P2-2] Store Refresh Token in DB