Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/modules/account/services/accountService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 = {};
Expand All @@ -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,
};
}
Expand Down