update
This commit is contained in:
@@ -2,6 +2,7 @@ import { useKeycloak } from "~/composables/useKeycloack"
|
||||
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
if (to.meta.public) return
|
||||
// if (!to.meta?.requiresAuth) return;
|
||||
|
||||
const { $pinia } = useNuxtApp()
|
||||
|
||||
@@ -11,8 +12,9 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
if (import.meta.client) {
|
||||
const userStore = useUserStore($pinia)
|
||||
if (!userStore.isAuthenticated && !isAuthenticated.value) {
|
||||
// await login({ redirectUri: window.location.origin + to.fullPath });
|
||||
return navigateTo('/auth/login')
|
||||
} else {
|
||||
console.log("its logged in!!! ")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user