mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
New function to verify auth
This commit is contained in:
parent
4ba3bc03de
commit
9706fee07b
2 changed files with 15 additions and 0 deletions
|
|
@ -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])
|
||||
}
|
||||
Loading…
Reference in a new issue