dev: hotfix, disable SSO temporarily
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useKeycloak } from "~/composables/useKeycloack"
|
||||
// import { useKeycloak } from "~/composables/useKeycloack"
|
||||
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
if (to.meta.public) return
|
||||
@@ -6,17 +6,17 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
|
||||
const { $pinia } = useNuxtApp()
|
||||
|
||||
const { initKeycloak, isAuthenticated, getResponse} = useKeycloak(); // global composable
|
||||
await initKeycloak("check-sso");
|
||||
// const { initKeycloak, isAuthenticated, getResponse} = useKeycloak(); // global composable
|
||||
// await initKeycloak("check-sso");
|
||||
|
||||
if (import.meta.client) {
|
||||
const userStore = useUserStore($pinia)
|
||||
if (!userStore.isAuthenticated && !isAuthenticated.value) {
|
||||
return navigateTo('/auth/login')
|
||||
} else {
|
||||
if (isAuthenticated.value) {
|
||||
await getResponse()
|
||||
}
|
||||
// if (isAuthenticated.value) {
|
||||
// await getResponse()
|
||||
// }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user