From aa91e3cb1523816d26f8626739c268256e0617b9 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Sat, 14 Mar 2026 09:33:38 +0330 Subject: [PATCH] refresh token --- src/modules/auth/controllers/auth.controller.ts | 12 ++++++------ src/modules/auth/services/auth.service.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/auth/controllers/auth.controller.ts b/src/modules/auth/controllers/auth.controller.ts index 7fc95ee..9ef3140 100644 --- a/src/modules/auth/controllers/auth.controller.ts +++ b/src/modules/auth/controllers/auth.controller.ts @@ -3,6 +3,7 @@ import { AuthService } from '../services/auth.service'; import { DirectLoginDto } from '../dto/direct-login.dto'; import { ApiTags, ApiOperation, ApiBody } from '@nestjs/swagger'; import { SuperAdminAuthGuard } from '../guards/superAdminAuth.guard'; +import { RefreshTokenDto } from '../dto/refresh-token.dto'; @ApiTags('auth') @Controller() @@ -40,12 +41,11 @@ export class AuthController { // return this.authService.verifyOtpAdmin(dto.phone, dto.slug, dto.otp); // } - // @RefreshTokenRateLimit() - // @ApiOperation({ summary: 'refresh the admin access token / refresh token' }) - // @Post('admin/auth/refresh') - // refreshTokenAdmin(@Body() refreshTokenDto: RefreshTokenDto) { - // return this.authService.refreshToken(refreshTokenDto.refreshToken); - // } + @ApiOperation({ summary: 'refresh the admin access token / refresh token' }) + @Post('admin/auth/refresh') + refreshTokenAdmin(@Body() refreshTokenDto: RefreshTokenDto) { + return this.authService.refreshToken(refreshTokenDto.refreshToken); + } // //super admin routes diff --git a/src/modules/auth/services/auth.service.ts b/src/modules/auth/services/auth.service.ts index 5c32bc9..056f3de 100644 --- a/src/modules/auth/services/auth.service.ts +++ b/src/modules/auth/services/auth.service.ts @@ -105,7 +105,7 @@ export class AuthService { // return code.toString(); // } - // refreshToken(oldRefreshToken: string) { - // return this.tokensService.refreshToken(oldRefreshToken); - // } + refreshToken(oldRefreshToken: string) { + return this.tokensService.refreshToken(oldRefreshToken); + } }