mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 11:34:53 +00:00
Update guard usage in controllers
This commit is contained in:
@ -14,9 +14,9 @@ import { UserSignUpDto } from '../dtos/user-auth.dto';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { ResponseMessage } from '../../../libs/common/src/response/response.decorator';
|
||||
import { UserLoginDto } from '../dtos/user-login.dto';
|
||||
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
||||
import { ForgetPasswordDto, UserOtpDto, VerifyOtpDto } from '../dtos';
|
||||
import { RefreshTokenGuard } from '@app/common/guards/jwt-refresh.auth.guard';
|
||||
import { AdminRoleGuard } from 'src/guards/admin.role.guard';
|
||||
|
||||
@Controller({
|
||||
version: '1',
|
||||
@ -52,7 +52,7 @@ export class UserAuthController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@Delete('user/delete/:id')
|
||||
async userDelete(@Param('id') id: string) {
|
||||
await this.userAuthService.deleteUser(id);
|
||||
@ -98,7 +98,7 @@ export class UserAuthController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(AdminRoleGuard)
|
||||
@Get('user/list')
|
||||
async userList() {
|
||||
const userList = await this.userAuthService.userList();
|
||||
|
||||
Reference in New Issue
Block a user