Final fix for client secret reading - remove runtime config conflict and force non-null environment variable

This commit is contained in:
2025-06-14 14:39:05 +02:00
parent 2effbb74bb
commit 2ceff9a67d
2 changed files with 15 additions and 22 deletions

View File

@@ -3,10 +3,20 @@ export default defineEventHandler((event) => {
// Return the OIDC configuration (without showing the actual secret)
return {
issuer: config.openidConnect?.op?.issuer || 'NOT_SET',
clientId: config.openidConnect?.op?.clientId || 'NOT_SET',
clientSecret: config.openidConnect?.op?.clientSecret ? '***SET***' : 'NOT_SET',
secretLength: config.openidConnect?.op?.clientSecret?.length || 0,
// Runtime config
runtime: {
issuer: config.openidConnect?.op?.issuer || 'NOT_SET',
clientId: config.openidConnect?.op?.clientId || 'NOT_SET',
clientSecret: config.openidConnect?.op?.clientSecret ? '***SET***' : 'NOT_SET',
secretLength: config.openidConnect?.op?.clientSecret?.length || 0,
},
// Build-time config (what the module actually uses)
buildTime: {
issuer: process.env.KEYCLOAK_ISSUER || 'NOT_SET',
clientId: process.env.KEYCLOAK_CLIENT_ID || 'NOT_SET',
clientSecret: process.env.KEYCLOAK_CLIENT_SECRET ? '***SET***' : 'NOT_SET',
secretLength: process.env.KEYCLOAK_CLIENT_SECRET?.length || 0,
},
environment: process.env.NODE_ENV,
envVars: {
KEYCLOAK_ISSUER: process.env.KEYCLOAK_ISSUER ? '***SET***' : 'NOT_SET',