260305:1654 20260305:1700 N8N bulid flow #2
All checks were successful
Build and Deploy / deploy (push) Successful in 3m12s
All checks were successful
Build and Deploy / deploy (push) Successful in 3m12s
This commit is contained in:
@@ -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),
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user