Redirect from '/home' to '/' if not logged in
This commit is contained in:
parent
94ffac287e
commit
90eaf83775
|
@ -55,6 +55,13 @@ export default function Home() {
|
||||||
useSaveReferral()
|
useSaveReferral()
|
||||||
usePrefetch(user?.id)
|
usePrefetch(user?.id)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (user === null) {
|
||||||
|
// Go to landing page if not logged in.
|
||||||
|
Router.push('/')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const groups = useMemberGroupsSubscription(user)
|
const groups = useMemberGroupsSubscription(user)
|
||||||
|
|
||||||
const { sections } = getHomeItems(groups ?? [], user?.homeSections ?? [])
|
const { sections } = getHomeItems(groups ?? [], user?.homeSections ?? [])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user