feat: add cors_origins

This commit is contained in:
Cipher Vance 2025-09-19 11:33:20 -05:00
parent daa90869cf
commit 3fec9d794d

View file

@ -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))