forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
8
src/decorators/user.decorator.ts
Normal file
8
src/decorators/user.decorator.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createParamDecorator, ExecutionContext } from "@nestjs/common";
|
||||
|
||||
export const CurrentUser = createParamDecorator(
|
||||
(data: unknown, ctx: ExecutionContext) => {
|
||||
const request = ctx.switchToHttp().getRequest();
|
||||
return request.user;
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user