mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
router: fix infinite redirect
This commit is contained in:
parent
12239ce9ff
commit
f0ea418ae7
1 changed files with 5 additions and 4 deletions
|
@ -13,10 +13,11 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||||
to.query.r = useRedirectUrl().value
|
to.query.r = useRedirectUrl().value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to.name === 'login' && isLoggedIn.value) {
|
if (to.name === 'login') {
|
||||||
|
if (isLoggedIn.value) {
|
||||||
return navigateTo('/')
|
return navigateTo('/')
|
||||||
}
|
}
|
||||||
if (!isLoggedIn.value && !(to.meta.public && settings.value.public)) {
|
} else if (!isLoggedIn.value && !(to.meta.public && settings.value.public)) {
|
||||||
return navigateTo('/login')
|
return navigateTo('/login')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue