Fixes public apps page (#2422)
This commit is contained in:
parent
61c60fc319
commit
81f3e824ff
1 changed files with 5 additions and 3 deletions
|
@ -57,9 +57,10 @@ function useRedirectToLoginIfUnauthenticated() {
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
const loading = status === "loading";
|
const loading = status === "loading";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const shouldDisplayUnauthed = router.pathname.startsWith("/apps");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (router.pathname.startsWith("/apps")) {
|
if (shouldDisplayUnauthed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +77,7 @@ function useRedirectToLoginIfUnauthenticated() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loading: loading && !session,
|
loading: loading && !session,
|
||||||
|
shouldDisplayUnauthed,
|
||||||
session,
|
session,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -134,7 +136,7 @@ export default function Shell(props: {
|
||||||
}) {
|
}) {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { loading, session } = useRedirectToLoginIfUnauthenticated();
|
const { loading, shouldDisplayUnauthed } = useRedirectToLoginIfUnauthenticated();
|
||||||
const { isRedirectingToOnboarding } = useRedirectToOnboardingIfNeeded();
|
const { isRedirectingToOnboarding } = useRedirectToOnboardingIfNeeded();
|
||||||
|
|
||||||
const telemetry = useTelemetry();
|
const telemetry = useTelemetry();
|
||||||
|
@ -207,7 +209,7 @@ export default function Shell(props: {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!session) return null;
|
if (!shouldDisplayUnauthed) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in a new issue