From 8016caa790710f4d3c71ba043b650d7100705a27 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 1 Mar 2026 10:11:42 -0300 Subject: [PATCH] fix(bootstrap): create OAuth client when Zitadel is already running - Added OAuth client creation to the 'already running' branch - Previously, OAuth client was only created when Zitadel was started - This fixes the issue where OAuth client wasn't created on subsequent runs Fixes the OAuth client creation issue discovered during testing. --- src/core/bootstrap/bootstrap_manager.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/bootstrap/bootstrap_manager.rs b/src/core/bootstrap/bootstrap_manager.rs index d1a7337bf..222685fad 100644 --- a/src/core/bootstrap/bootstrap_manager.rs +++ b/src/core/bootstrap/bootstrap_manager.rs @@ -176,6 +176,16 @@ impl BootstrapManager { if directory_already_running { info!("Zitadel/Directory service is already running"); + + // Create OAuth client if config doesn't exist (even when already running) + let config_path = self.stack_dir("conf/system/directory_config.json"); + if !config_path.exists() { + info!("Creating OAuth client for Directory service..."); + match crate::core::package_manager::setup_directory().await { + Ok(_) => info!("OAuth client created successfully"), + Err(e) => warn!("Failed to create OAuth client: {}", e), + } + } } else { info!("Starting Zitadel/Directory service..."); match pm.start("directory") {