Skip to content

Commit

Permalink
feat : token 내부 정보 인터페이스 구현 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
GeunH committed Nov 17, 2023
1 parent fc27bef commit 91a04d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions be/src/user/user.decorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ExecutionContext, createParamDecorator } from "@nestjs/common";

interface TokenInfo {
nickname: string;
}

export const GetUser = createParamDecorator((data, ctx: ExecutionContext): TokenInfo => {
const req = ctx.switchToHttp().getRequest();
return req.user;
})

0 comments on commit 91a04d8

Please sign in to comment.