From 49148ceb7ec082da18517b5ea334ffa50d80742c Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 8 May 2025 09:10:15 -0600 Subject: fix: temporarily disable signed cookies in staging/production --- pkg/web/cookie.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg') diff --git a/pkg/web/cookie.go b/pkg/web/cookie.go index d8ba658..5123bbe 100644 --- a/pkg/web/cookie.go +++ b/pkg/web/cookie.go @@ -32,6 +32,10 @@ func NewCookie(name, value string, options ...x.Option[*http.Cookie]) *http.Cook } func withSignedValue(value string) x.Option[*http.Cookie] { + if env.Fetch("APP_ENV", "development") == "production" { + return cookie.WithValue(value) + } + signature, err := Signer.Sign([]byte(value)) if err != nil { return cookie.WithValue(value) @@ -54,6 +58,10 @@ func ExpireCookie(w http.ResponseWriter, name string) { } func CookieValueFrom(c *http.Cookie) string { + if env.Fetch("APP_ENV", "development") == "production" { + return c.Value + } + segments := strings.SplitN(c.Value, delimiter, 2) if len(segments) != 2 { return "" -- cgit v1.2.3