fix query string checking to avoid wrong redirection

Signed-off-by: jffarge <jf@dagger.io>
This commit is contained in:
jffarge 2022-03-14 12:31:33 +01:00
parent c0aa326707
commit bb8a79844e

View File

@ -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));