New function to verify auth

This commit is contained in:
Jackson Harper
2024-03-05 12:48:23 +08:00
parent 4ba3bc03de
commit 9706fee07b
2 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import { useApplyLocalTheme } from '../../lib/hooks/useApplyLocalTheme'
import { updateTheme } from '../../lib/themeUpdater'
import { Priority, useRegisterActions } from 'kbar'
import { ThemeId } from '../tokens/stitches.config'
import { useVerifyAuth } from '../../lib/hooks/useVerifyAuth'
type PrimaryLayoutProps = {
children: ReactNode
@ -25,6 +26,7 @@ type PrimaryLayoutProps = {
}
export function PrimaryLayout(props: PrimaryLayoutProps): JSX.Element {
useVerifyAuth()
useApplyLocalTheme()
const { viewerData } = useGetViewerQuery()

View File

@ -0,0 +1,13 @@
import { useEffect } from 'react'
import { useRouter } from 'next/router'
export function useVerifyAuth() {
const router = useRouter()
useEffect(() => {
if (window.localStorage.getItem('authVerified')) {
console.log('not verified')
return
}
}, [router])
}