From 14f30e9d7e3ec89a4a60731d8aae0176eddc2136 Mon Sep 17 00:00:00 2001 From: J-hoplin1 Date: Sat, 29 Jun 2024 20:02:22 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20GetUser=EB=8D=B0=EC=BD=94=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EC=97=90=EC=84=9C=20=EB=94=94=ED=8F=B4?= =?UTF-8?q?=ED=8A=B8=EB=A1=9C=20id=ED=95=84=EB=93=9C=20=EB=B0=98=ED=99=98?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/decorators/getUser.decorator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/decorators/getUser.decorator.ts b/src/common/decorators/getUser.decorator.ts index 48c296f..fbf7f53 100644 --- a/src/common/decorators/getUser.decorator.ts +++ b/src/common/decorators/getUser.decorator.ts @@ -18,7 +18,7 @@ export const GetUser = createParamDecorator( const request = context.switchToHttp().getRequest(); // Expect Request, user property as type 'ReqUserPayload'(Refer to defined in common/types/type.d.ts) - const user: ReqUserPayload = (request.user ?? {}) as ReqUserPayload; - return property ? user[property] : user; + const user: Express.User = request.user; + return user['id']; }, );