Skip to content

Commit

Permalink
refactor: chagne auth files path
Browse files Browse the repository at this point in the history
  • Loading branch information
seo-wo committed Dec 13, 2023
1 parent 712fcd1 commit ec866db
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { UseGuards, Controller, Get } from '@nestjs/common';
import { UseGuards, Controller, Get, Logger } from '@nestjs/common';
import { UserService } from './user.service';
import { GetUser } from 'src/decorator/user.decorator';
import { JwtGuard } from 'src/auth/jwt/jwt.guard';
import { RoleGuard } from 'src/auth/role/role.guard';
import { JwtGuard } from 'src/auth/guard/jwt.guard';
import { RoleGuard } from 'src/auth/guard/role.guard';
import { Role } from 'src/decorator/role.decorator';
import UserRole from './enum/user.enum';
import { ApiBearerAuth } from '@nestjs/swagger';
import { JwtRefreshGuard } from 'src/auth/guard/jwt-refresh.guard';

@Controller('user')
export class UserController {
private readonly logger = new Logger(UserController.name);
constructor(private readonly userService: UserService) {}

@Get('test')
@UseGuards(JwtGuard, RoleGuard)
@ApiBearerAuth()
@Role([UserRole.USER, UserRole.LIBRARIAN, UserRole.ADMIN])
async jwtAuthTest(@GetUser() user) {
console.log('user', user);
this.logger.debug(`jwtAuthTest [user: ${JSON.stringify(user)}]`);
return 'jwtAuthTest';
}
}

0 comments on commit ec866db

Please sign in to comment.