New function to verify auth
This commit is contained in:
@ -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()
|
||||
|
||||
13
packages/web/lib/hooks/useVerifyAuth.tsx
Normal file
13
packages/web/lib/hooks/useVerifyAuth.tsx
Normal 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])
|
||||
}
|
||||
Reference in New Issue
Block a user