Skip to content

Commit

Permalink
fix: remove err and code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Mar 22, 2024
1 parent e5c6669 commit 5b66bd4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/home/getters/get-github-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@ async function getNewSessionToken(): Promise<string | null> {
const params = new URLSearchParams(hash.substr(1)); // remove the '#' and parse
const providerToken = params.get("provider_token");
if (!providerToken) {
const err = params.get("error");
const code = params.get("error_code");
const desc = params.get("error_description");

if (err === "server_error") {
if (code === "500") {
if (desc === "Error getting user profile from external provider") {
// without a token we can't get a dynamic retry timeframe
displayPopupMessage(`GitHub Login Provider`, `Your access token may have reached it's rate limit, please try again after one hour.`);
console.error("GitHub login provider");
}
}
if (desc === "Error getting user profile from external provider") {
// without a token we can't get a dynamic retry timeframe
displayPopupMessage(`GitHub Login Provider`, `Your access token may have reached it's rate limit, please try again after one hour.`);
console.error("GitHub login provider");
}
}

return providerToken || null;
}

Expand Down

0 comments on commit 5b66bd4

Please sign in to comment.