Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

feat: OIDC_PROMPT param support

Blue Mouse99a4bcd79932
diff --git a/backend/.env.example b/backend/.env.example
index 099aaadb2..ea686d386 100644
--- a/backend/.env.example
+++ b/backend/.env.example
@@ -50,6 +50,7 @@ OIDC_ONLY_AUTH=false
OIDC_DISCOVERY_URL=http://localhost:8080/.well-known/openid-configuration
OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
+OIDC_PROMPT=select_account
# Google SSO
GOOGLE_OAUTH2_CLIENT_ID=
diff --git a/backend/apps/community/src/auth/auth.service.ts b/backend/apps/community/src/auth/auth.service.ts
index 8bf376f61..e4e9f4da8 100644
--- a/backend/apps/community/src/auth/auth.service.ts
+++ b/backend/apps/community/src/auth/auth.service.ts
@@ -302,6 +302,7 @@ export class AuthService {
discoveryURL: this.configService.get('OIDC_DISCOVERY_URL'),
clientID: this.configService.get('OIDC_CLIENT_ID'),
clientSecret: this.configService.get('OIDC_CLIENT_SECRET'),
+ prompt: this.configService.get('OIDC_PROMPT') || 'select_account',
scope: 'openid email profile',
}
}
@@ -334,7 +335,7 @@ export class AuthService {
const config = this.getOidcConfig()
return {
- auth_url: `${discovery.authorization_endpoint}?client_id=${config.clientID}&response_type=code&scope=${encodeURIComponent(config.scope)}&redirect_uri=${encodeURIComponent(redirectUrl)}&state=${uuid}&prompt=select_account`,
+ auth_url: `${discovery.authorization_endpoint}?client_id=${config.clientID}&response_type=code&scope=${encodeURIComponent(config.scope)}&redirect_uri=${encodeURIComponent(redirectUrl)}&state=${uuid}&prompt=${encodeURIComponent(config.prompt)}`,
uuid,
expires_in: REDIS_OIDC_SESSION_TIMEOUT * 1000, // milliseconds
}