forked from Ivasoft/geovisio-website
fix
This commit is contained in:
@@ -35,10 +35,14 @@ router.beforeEach(async (to: RouteLocationNormalized) => {
|
||||
const loggedPages = ['/mon-compte']
|
||||
const authRequired = loggedPages.includes(to.path)
|
||||
const isLogged = !!cookies.get('user_id')
|
||||
const { data } = await axios.get(
|
||||
`${import.meta.env.VITE_API_URL}api/auth/login`
|
||||
)
|
||||
console.log(data)
|
||||
try {
|
||||
const { data } = await axios.get(
|
||||
`${import.meta.env.VITE_API_URL}api/auth/login`
|
||||
)
|
||||
console.log(data)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
if (!isLogged && authRequired) {
|
||||
return (window.location.href = `${
|
||||
import.meta.env.VITE_API_URL
|
||||
|
||||
Reference in New Issue
Block a user