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