From a4986f2d9e7143b469b48f2dce54040a0ff9e81e Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 7 Nov 2024 23:11:06 -0300 Subject: [PATCH 1/2] feat: fix auth double render --- src/home/authentication.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/home/authentication.ts b/src/home/authentication.ts index 41fe11ae..2186d723 100644 --- a/src/home/authentication.ts +++ b/src/home/authentication.ts @@ -11,13 +11,14 @@ export async function authentication() { return; } + const accessToken = getGitHubAccessToken(); + if (!accessToken) { + renderGitHubLoginButton(); + } + const gitHubUser: null | GitHubUser = await getGitHubUser(); if (gitHubUser) { await trackReferralCode(); await displayGitHubUserInformation(gitHubUser); } - const accessToken = await getGitHubAccessToken(); - if (!accessToken) { - renderGitHubLoginButton(); - } } From 56c94b0594a48a9f8d469cc89360c49a729d4675 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 7 Nov 2024 23:24:19 -0300 Subject: [PATCH 2/2] feat: getGitHubAccessToken should be awaited --- src/home/authentication.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/home/authentication.ts b/src/home/authentication.ts index 2186d723..c110f705 100644 --- a/src/home/authentication.ts +++ b/src/home/authentication.ts @@ -11,7 +11,7 @@ export async function authentication() { return; } - const accessToken = getGitHubAccessToken(); + const accessToken = await getGitHubAccessToken(); if (!accessToken) { renderGitHubLoginButton(); }