frontend: Login-Redirect for unauth requests
This commit is contained in:
parent
ffbbd3d0ac
commit
c8b6e4757f
4 changed files with 62 additions and 27 deletions
|
|
@ -1,7 +1,11 @@
|
|||
export default defineNuxtRouteMiddleware((to) => {
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
if (import.meta.server) return // SSR ignorieren
|
||||
// allow login-page
|
||||
|
||||
if (to.meta.requiresAuth !== true) {
|
||||
return
|
||||
}
|
||||
|
||||
const { token, loadToken } = useAuth()
|
||||
loadToken()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue