Merge pull request #1794 from slumbering/issue#1793-docs-redirection

[docs] fix query string checking to avoid wrong redirection
This commit is contained in:
Gerhard Lazu 2022-03-14 12:36:41 +00:00 committed by GitHub
commit 35751bc212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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