refresh token
This commit is contained in:
@@ -3,6 +3,7 @@ import { AuthService } from '../services/auth.service';
|
|||||||
import { DirectLoginDto } from '../dto/direct-login.dto';
|
import { DirectLoginDto } from '../dto/direct-login.dto';
|
||||||
import { ApiTags, ApiOperation, ApiBody } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiBody } from '@nestjs/swagger';
|
||||||
import { SuperAdminAuthGuard } from '../guards/superAdminAuth.guard';
|
import { SuperAdminAuthGuard } from '../guards/superAdminAuth.guard';
|
||||||
|
import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
||||||
|
|
||||||
@ApiTags('auth')
|
@ApiTags('auth')
|
||||||
@Controller()
|
@Controller()
|
||||||
@@ -40,12 +41,11 @@ export class AuthController {
|
|||||||
// return this.authService.verifyOtpAdmin(dto.phone, dto.slug, dto.otp);
|
// return this.authService.verifyOtpAdmin(dto.phone, dto.slug, dto.otp);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// @RefreshTokenRateLimit()
|
@ApiOperation({ summary: 'refresh the admin access token / refresh token' })
|
||||||
// @ApiOperation({ summary: 'refresh the admin access token / refresh token' })
|
@Post('admin/auth/refresh')
|
||||||
// @Post('admin/auth/refresh')
|
refreshTokenAdmin(@Body() refreshTokenDto: RefreshTokenDto) {
|
||||||
// refreshTokenAdmin(@Body() refreshTokenDto: RefreshTokenDto) {
|
return this.authService.refreshToken(refreshTokenDto.refreshToken);
|
||||||
// return this.authService.refreshToken(refreshTokenDto.refreshToken);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// //super admin routes
|
// //super admin routes
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export class AuthService {
|
|||||||
// return code.toString();
|
// return code.toString();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// refreshToken(oldRefreshToken: string) {
|
refreshToken(oldRefreshToken: string) {
|
||||||
// return this.tokensService.refreshToken(oldRefreshToken);
|
return this.tokensService.refreshToken(oldRefreshToken);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user