diff options
Diffstat (limited to 'server/decorators')
-rw-r--r-- | server/decorators/gateway_jwt_body.decorator.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/decorators/gateway_jwt_body.decorator.ts b/server/decorators/gateway_jwt_body.decorator.ts new file mode 100644 index 0000000..c31b47e --- /dev/null +++ b/server/decorators/gateway_jwt_body.decorator.ts @@ -0,0 +1,6 @@ +import { createParamDecorator, ExecutionContext } from '@nestjs/common'; +import { Socket } from 'socket.io'; +export const GatewayJwtBody = createParamDecorator((data: unknown, ctx: ExecutionContext) => { + const req = ctx.switchToHttp().getRequest() as Socket; + return req.handshake.auth.jwtBody; +}); |