MAJOR: Replace nuxt-openid-connect with official Keycloak JS adapter
- Remove problematic nuxt-openid-connect module that was causing OAuth issues - Install and implement official keycloak-js adapter for better reliability - Create new useKeycloak composable with proper token management - Update useUnifiedAuth to work with new Keycloak implementation - Fix authentication middleware to support both auth methods - Update login page to use new Keycloak login function - Clean up configuration and remove deprecated OIDC settings - This should resolve all the HTTP/HTTPS redirect and token exchange issues
This commit is contained in:
@@ -6,8 +6,14 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const isAuthRequired = to.meta.auth !== false;
|
||||
|
||||
// Check Keycloak auth first
|
||||
const oidc = useOidc();
|
||||
if (oidc.isLoggedIn) {
|
||||
const keycloak = useKeycloak();
|
||||
|
||||
// Initialize Keycloak if not already initialized
|
||||
if (!keycloak.isInitialized.value) {
|
||||
await keycloak.initKeycloak();
|
||||
}
|
||||
|
||||
if (keycloak.isAuthenticated.value) {
|
||||
// User authenticated with Keycloak
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user