Code styling changes
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
import { PropsWithChildren, useEffect } from "react"
|
||||
import { getToken } from "../utils/auth"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
import { PropsWithChildren, useEffect } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import { getToken } from '../utils/auth'
|
||||
|
||||
function WithToken({ children }: PropsWithChildren) {
|
||||
const navigate = useNavigate()
|
||||
|
||||
useEffect(() => {
|
||||
if (!getToken()) {
|
||||
return navigate("/login")
|
||||
return navigate('/login')
|
||||
}
|
||||
}, [navigate])
|
||||
|
||||
|
Reference in New Issue
Block a user