From 17c6811c93eb2893b27196c6a5a417658391f373 Mon Sep 17 00:00:00 2001 From: GeunH Date: Fri, 1 Dec 2023 19:09:58 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20accessToken=20=EC=9E=AC=EB=B0=9C?= =?UTF-8?q?=EA=B8=89=20=EC=8B=9C=20refreshToken=EC=9D=98=20=EC=9C=A0?= =?UTF-8?q?=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=A6=9D=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20#35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/src/auth/auth.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/be/src/auth/auth.service.ts b/be/src/auth/auth.service.ts index cc7decdd..d1ef39e1 100644 --- a/be/src/auth/auth.service.ts +++ b/be/src/auth/auth.service.ts @@ -83,8 +83,7 @@ export class AuthService { const decoded = this.jwtService.verify(refreshToken, { secret: "nibobnebob", }); - const result = this.authRepository.findOne({ where: { id: decoded.id } }) - if (result) { + if (await this.authRepository.findOne({ where: { id: decoded.id, refreshToken: refreshToken } })) { const payload = { id: decoded.id }; const accessToken = this.jwtService.sign(payload); await this.authRepository.update(decoded.id, { accessToken: accessToken });