diff --git a/backend/src/main/java/com/dbaagent/controller/SetupController.java b/backend/src/main/java/com/dbaagent/controller/SetupController.java index 0c87351..fbceab9 100644 --- a/backend/src/main/java/com/dbaagent/controller/SetupController.java +++ b/backend/src/main/java/com/dbaagent/controller/SetupController.java @@ -6,6 +6,7 @@ import com.dbaagent.service.SystemConfigService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestClient; @@ -34,6 +35,17 @@ public class SetupController { private final CredentialRepository credentialRepository; private final LlmConfigResolver llmConfigResolver; + /** + * Mirrors {@code security.google.enabled}. Surfaced on the public status + * endpoint so the login page can decide whether to offer Google sign-in — + * it is otherwise unauthenticated and has no way to know the server was + * configured for SSO. Deliberately NOT final: {@code @RequiredArgsConstructor} + * would pull a final field into the constructor and Spring has no bean to + * satisfy it. + */ + @Value("${security.google.enabled:false}") + private boolean googleEnabled; + // ── GET /setup/status ───────────────────────────────────────────────────── /** Returns setup completion state. Public endpoint — no auth required. */ @@ -53,7 +65,8 @@ public SetupStatusResponse getStatus() { setupComplete, hasOrgInfo, hasConnections, - hasLlmConfig + hasLlmConfig, + googleEnabled ); } @@ -278,7 +291,9 @@ public record SetupStatusResponse( boolean setupComplete, boolean hasOrganizationInfo, boolean hasConnections, - boolean hasLlmConfig + boolean hasLlmConfig, + /** Whether Google Workspace SSO is configured; drives the login page's SSO button. */ + boolean googleEnabled ) {} public record InitializeRequest(String orgName, String adminUsername, String adminEmail, String adminPassword) {} diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index 80e0d41..308ec5f 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -99,6 +99,7 @@ export default function Login() { const renderLoginStep = () => ( + <>