From 5efa84b0547e179e508301e44fac31d3a3976210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 20 Sep 2022 09:05:45 +0900 Subject: [PATCH] auth_backend... --- src/auth/auth.controller.ts | 2 +- src/auth/guards/jwt.refreshtoken.stragy.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 365f79d..3390c96 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -26,7 +26,7 @@ export class AuthController { //jwt.strategy의 validate에서 true인경우 넘어옴 @UseGuards(JwtRefreshTokenGuard) - @Get('reload') + @Post('reload') async reload(@Request() req) { return await this.authService.reload(req.user) } diff --git a/src/auth/guards/jwt.refreshtoken.stragy.ts b/src/auth/guards/jwt.refreshtoken.stragy.ts index 90f08f2..37d1f25 100644 --- a/src/auth/guards/jwt.refreshtoken.stragy.ts +++ b/src/auth/guards/jwt.refreshtoken.stragy.ts @@ -25,10 +25,12 @@ export class JwtRefreshTokenStrategy extends PassportStrategy( //AccessToken 인증 async validate(payload: jwtPayloadRefreshToken) { try { - return await this.authService.validateUser({ + const where = { email: payload.email, name: payload.name - }) + } + console.log(where) + return await this.authService.validateUser(where) } catch (e) { throw new UnauthorizedException(e) }