From 3fec9d794d54552807fc2de00fcaadd8aa97f0d3 Mon Sep 17 00:00:00 2001 From: Cipher Vance Date: Fri, 19 Sep 2025 11:33:20 -0500 Subject: [PATCH] feat: add cors_origins --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 215c2a6..08341e5 100644 --- a/main.go +++ b/main.go @@ -50,7 +50,12 @@ func main() { MaxAge: 60 * 80 * 24 * 7, // 7 days HttpOnly: true, Secure: os.Getenv("ENV") == "production", - SameSite: http.SameSiteLaxMode, + SameSite: func() http.SameSite { + if os.Getenv("CORS_ORIGINS") != "" { + return http.SameSiteNoneMode + } + return http.SameSiteLaxMode + }(), }) r.Use(sessions.Sessions("rideaware-session", store))