diff --git a/internal/web/server.go b/internal/web/server.go index 41e4c68..0f3d97c 100644 --- a/internal/web/server.go +++ b/internal/web/server.go @@ -2154,6 +2154,12 @@ func (s *Server) handleSettings(w http.ResponseWriter, r *http.Request) { "LLMModel": allSettings[settings.KeyLLMModel], "LLMMaxTokens": maxTokens, "PublicBaseURL": allSettings[settings.KeyPublicBaseURL], + // Derived from PublicBaseURL via the same publicBaseURL() helper + // used by googleOAuthConfig.RedirectURL, so what the operator sees + // here is byte-for-byte the URL Sieve will send to OAuth providers. + // Surfacing it on the settings page is the lowest-friction way to + // avoid Error 400: redirect_uri_mismatch on the provider side. + "OAuthCallbackURL": s.publicBaseURL(r) + "/oauth/callback", "CommandAllowlist": allSettings[settings.KeyCommandAllowlist], "AdminTLSCertPath": allSettings[settings.KeyAdminTLSCertPath], "AdminTLSKeyPath": allSettings[settings.KeyAdminTLSKeyPath], diff --git a/internal/web/templates/settings.html b/internal/web/templates/settings.html index b7f2ddf..341891f 100644 --- a/internal/web/templates/settings.html +++ b/internal/web/templates/settings.html @@ -126,6 +126,11 @@
Externally-visible base URL used when Sieve constructs OAuth callback / redirect / setup URLs (GitHub App manifest, Google OAuth, Slack install). Default http://127.0.0.1:19816 matches the documented loopback production binding. Set this to your reverse-proxy URL if the admin UI is reached at a different address — never relied on inbound Host headers.
OAuth callback URL Sieve will send
+Register this URL in your Google Cloud Console OAuth client (Authorized redirect URIs), your Slack App config, and any other OAuth provider you use. A mismatch produces Error 400: redirect_uri_mismatch on the provider's consent screen and the user cannot complete authentication.
{{.OAuthCallbackURL}}
+