From bb8a79844e89413982a360e8623823ceb6b84611 Mon Sep 17 00:00:00 2001 From: jffarge Date: Mon, 14 Mar 2022 12:31:33 +0100 Subject: [PATCH] fix query string checking to avoid wrong redirection Signed-off-by: jffarge --- website/src/components/DocPageCustom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/components/DocPageCustom.js b/website/src/components/DocPageCustom.js index 46bf35ac..f97509ad 100644 --- a/website/src/components/DocPageCustom.js +++ b/website/src/components/DocPageCustom.js @@ -14,8 +14,8 @@ function DocPageCustom({ location, userAccessStatus, setUserAccessStatus }) { useEffect(async () => { NProgress.start() - if (!isEmpty(authQuery) && userAccessStatus === null) { //callback after successful auth with github - const user = await checkUserCollaboratorStatus(authQuery.code); + if (!isEmpty(authQuery?.code) && userAccessStatus === null) { //callback after successful auth with github + const user = await checkUserCollaboratorStatus(authQuery?.code); setUserAccessStatus(user) if (user?.permission) { window.localStorage.setItem('user', JSON.stringify(user));