diff --git a/client/web/src/hooks/auth.ts b/client/web/src/hooks/auth.ts index 428d6025a..0f30f18f3 100644 --- a/client/web/src/hooks/auth.ts +++ b/client/web/src/hooks/auth.ts @@ -41,6 +41,7 @@ export default function useAuth() { default: setLoading(false) } + return d }) .catch((error) => { setLoading(false) @@ -64,10 +65,14 @@ export default function useAuth() { }, []) useEffect(() => { - loadAuth() - if (new URLSearchParams(window.location.search).get("check") == "now") { - newSession() - } + loadAuth().then((d) => { + if ( + !d.canManageNode && + new URLSearchParams(window.location.search).get("check") == "now" + ) { + newSession() + } + }) }, []) return {