From f99087b2bd649bd657bffc5c76910deb4001dadc Mon Sep 17 00:00:00 2001 From: rishikanthc Date: Tue, 16 Dec 2025 17:21:32 -0800 Subject: [PATCH] fix: Resolve mobile audio playback permission issues - Change cookie SameSite policy from Strict to Lax (Strict blocks media subresources on mobile) - Decouple Secure cookie flag from APP_ENV: - Add SECURE_COOKIES config (defaults to true in prod, but can be overridden) - Allows testing production builds over HTTP (home network) - Increase gocyclo threshold to 25 to accommodate complex handlers --- .golangci.yml | 2 +- internal/api/handlers.go | 20 +++++++++----------- internal/config/config.go | 8 ++++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0d1f20b..852b810 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,7 +45,7 @@ linters-settings: - name: errorf gocyclo: - # minimal code complexity to report, 30 by default (25 is reasonable for complex handlers) + # minimal code complexity to report, 30 by default (but we want it slightly stricter but still sane) min-complexity: 25 goconst: diff --git a/internal/api/handlers.go b/internal/api/handlers.go index 41d3982..cf52004 100644 --- a/internal/api/handlers.go +++ b/internal/api/handlers.go @@ -1547,17 +1547,15 @@ func (h *Handler) Login(c *gin.Context) { } // Set access token cookie for streaming/media access - // We use Lax mode to allow top-level navigation authentication if needed, but Strict is safer for API. - // Since we use this for