@@ -149,7 +149,6 @@ impl AdminSettingsService {
149149 /// Get OIDC settings for display in admin UI (secrets masked).
150150 pub async fn get_oidc_settings ( & self ) -> Result < OidcSettingsDto , DomainError > {
151151 let db = self . settings_repo . get_by_category ( "oidc" ) . await ?;
152- let d = OidcConfig :: default ( ) ;
153152
154153 let has_secret = db
155154 . get ( "oidc.client_secret" )
@@ -159,29 +158,20 @@ impl AdminSettingsService {
159158 . map ( |s| !s. is_empty ( ) )
160159 . unwrap_or ( false ) ;
161160
161+ // Load effective config with env var overrides applied
162+ let effective = self . load_effective_oidc_config ( ) . await ?;
163+
162164 Ok ( OidcSettingsDto {
163- enabled : db
164- . get ( "oidc.enabled" )
165- . and_then ( |v| v. parse ( ) . ok ( ) )
166- . unwrap_or ( d. enabled ) ,
167- issuer_url : db. get ( "oidc.issuer_url" ) . cloned ( ) . unwrap_or_default ( ) ,
168- client_id : db. get ( "oidc.client_id" ) . cloned ( ) . unwrap_or_default ( ) ,
165+ enabled : effective. enabled ,
166+ issuer_url : effective. issuer_url ,
167+ client_id : effective. client_id ,
169168 client_secret_set : has_secret,
170- scopes : db. get ( "oidc.scopes" ) . cloned ( ) . unwrap_or ( d. scopes ) ,
171- auto_provision : db
172- . get ( "oidc.auto_provision" )
173- . and_then ( |v| v. parse ( ) . ok ( ) )
174- . unwrap_or ( d. auto_provision ) ,
175- admin_groups : db. get ( "oidc.admin_groups" ) . cloned ( ) . unwrap_or_default ( ) ,
176- disable_password_login : db
177- . get ( "oidc.disable_password_login" )
178- . and_then ( |v| v. parse ( ) . ok ( ) )
179- . unwrap_or ( d. disable_password_login ) ,
180- provider_name : db
181- . get ( "oidc.provider_name" )
182- . cloned ( )
183- . unwrap_or ( d. provider_name ) ,
184- callback_url : self . callback_url ( ) ,
169+ scopes : effective. scopes ,
170+ auto_provision : effective. auto_provision ,
171+ admin_groups : effective. admin_groups ,
172+ disable_password_login : effective. disable_password_login ,
173+ provider_name : effective. provider_name ,
174+ callback_url : effective. redirect_uri . clone ( ) ,
185175 env_overrides : self . get_env_overrides ( ) ,
186176 } )
187177 }
0 commit comments