This commit is contained in:
2025-11-11 10:35:58 +03:30
parent e34b93aa83
commit 5dd7a6588e
5 changed files with 15 additions and 10 deletions
+2 -2
View File
@@ -21,10 +21,10 @@ export class AuthService {
) {}
async requestOtp(dto: RequestOtpDto) {
const { phone } = dto;
const { phone, slug } = dto;
const code = this.generateOtpCode();
await this.cacheService.set(`otp:${phone}`, code, 160);
await this.cacheService.set(`otp:${phone}:${slug}`, code, 160);
await this.smsService.sendOtp(phone, code);
+1 -1
View File
@@ -34,7 +34,7 @@ export class TokensService {
const refreshExpire = this.configService.getOrThrow<number>('REFRESH_TOKEN_EXPIRE');
const accessToken = await this.jwtService.signAsync(payload, { expiresIn: `${accessExpire}m` });
const refreshToken = await this.generateRefreshToken();
const refreshToken = this.generateRefreshToken();
await this.storeRefreshToken(payload.id, refreshToken, em);