We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3501b47 commit c36ae76Copy full SHA for c36ae76
2 files changed
src/decorators/auth-user.decorator.ts
@@ -1,5 +1,6 @@
1
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
2
import { UserAuth } from '../types/userAuth.type';
3
+import { Request } from 'express';
4
5
export const AuthUser = createParamDecorator<UserAuth>(
6
(data: unknown, ctx: ExecutionContext): UserAuth => {
src/types/express.d.ts
@@ -3,6 +3,6 @@ import { UserAuth } from './userAuth.type';
declare module 'express' {
export interface Request {
- user?: UserAuth;
+ user: UserAuth;
7
}
8
0 commit comments