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:
2025-06-14 14:50:29 +02:00
parent bd8f1d9926
commit a797c13867
7 changed files with 159 additions and 128 deletions

View File

@@ -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;
}