Redirect from '/home' to '/' if not logged in

This commit is contained in:
James Grugett 2022-09-26 17:04:08 -04:00
parent 94ffac287e
commit 90eaf83775

View File

@ -55,6 +55,13 @@ export default function Home() {
useSaveReferral()
usePrefetch(user?.id)
useEffect(() => {
if (user === null) {
// Go to landing page if not logged in.
Router.push('/')
}
})
const groups = useMemberGroupsSubscription(user)
const { sections } = getHomeItems(groups ?? [], user?.homeSections ?? [])