Skip to content

Commit

Permalink
add user guard
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed Mar 9, 2024
1 parent a1a484b commit 138ba83
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/user/decorator/getUser.decorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { User } from '@prisma/client';

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

0 comments on commit 138ba83

Please sign in to comment.