Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ func DefaultConfig() *Config {
ReadTimeout: "10s",
WriteTimeout: "30s",
IdleTimeout: "60s",
MarketingURL: "http://localhost:5173",
// Intentionally empty — an unset MarketingURL makes marketing
// redirects 404 cleanly. The old localhost default leaked into
// production OAuth redirects when operators forgot to set the
// env var, sending real users to http://localhost:5173.
MarketingURL: "",
CookieDomain: "",
AllowedOrigins: []string{
"http://localhost:5173",
Expand Down
3 changes: 3 additions & 0 deletions internal/server/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func TestDefaultConfig(t *testing.T) {
if cfg.Email.FromAddress != "no-reply@example.com" {
t.Errorf("Email.FromAddress = %q, want %q", cfg.Email.FromAddress, "no-reply@example.com")
}
if cfg.Server.MarketingURL != "" {
t.Errorf("Server.MarketingURL default = %q, want empty string (no localhost leak in prod)", cfg.Server.MarketingURL)
}
}

// TestOverrideWithEnv_FillsEmptySecrets verifies env vars populate Config fields
Expand Down
Loading