[Permissions] Add userWorkspaceId to JWT token (#9954)
This information will be used to fetch a user's role and check their permissions
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
import { ExecutionContext, createParamDecorator } from '@nestjs/common';
|
||||
|
||||
import { getRequest } from 'src/utils/extract-request';
|
||||
|
||||
export const AuthUserWorkspaceId = createParamDecorator(
|
||||
(data: unknown, ctx: ExecutionContext) => {
|
||||
const request = getRequest(ctx);
|
||||
|
||||
return request.userWorkspaceId;
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user