From 6a77bd091135b6925ca8121d5808f83228b2e1b6 Mon Sep 17 00:00:00 2001 From: Sunny Date: Wed, 7 Aug 2024 12:59:10 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Account=20googleOauth=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/account/services/accountService.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/modules/account/services/accountService.js b/src/modules/account/services/accountService.js index b4f46c6..a99008c 100644 --- a/src/modules/account/services/accountService.js +++ b/src/modules/account/services/accountService.js @@ -39,10 +39,6 @@ const accountService = { }), }); - if (!tokenResponse.ok) { - throw new Error("Failed to fetch Google token"); - } - const tokenData = await tokenResponse.json(); const accessToken = tokenData.access_token; @@ -53,10 +49,6 @@ const accountService = { }, }); - if (!userInfoResponse.ok) { - throw new Error("Failed to fetch user info from Google"); - } - const googleAccountInfo = await userInfoResponse.json(); let result = {}; @@ -78,9 +70,9 @@ const accountService = { result = { token: token, isAccountExist: true }; } else { result = { - oauthGoogleId: googleAccountInfo.data.id, - googleName: googleAccountInfo.data.name, - googleProfileImg: googleAccountInfo.data.picture, + oauthGoogleId: googleAccountInfo.id, + googleName: googleAccountInfo.name, + googleProfileImg: googleAccountInfo.picture, isAccountExist: false, }; }