summaryrefslogtreecommitdiff
path: root/pkg/web
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-09 11:42:49 -0600
committermo khan <mo@mokhan.ca>2025-05-09 11:42:49 -0600
commitc164c0172c18a76ebd3dbded32e26fe624806dd8 (patch)
treef492f01d1823b70f9785cbe58457a08929f45b08 /pkg/web
parentc58a2f0bc881a82d3ca7d82aa975fba11afe9efd (diff)
feat: attempt to sign cookies on staging/production
Diffstat (limited to 'pkg/web')
-rw-r--r--pkg/web/cookie.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/pkg/web/cookie.go b/pkg/web/cookie.go
index fd81c1d..15a2cad 100644
--- a/pkg/web/cookie.go
+++ b/pkg/web/cookie.go
@@ -9,7 +9,6 @@ import (
"github.com/xlgmokha/x/pkg/cookie"
"github.com/xlgmokha/x/pkg/crypt"
- "github.com/xlgmokha/x/pkg/env"
"github.com/xlgmokha/x/pkg/pls"
"github.com/xlgmokha/x/pkg/x"
)
@@ -30,10 +29,6 @@ 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)
@@ -55,10 +50,6 @@ 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 ""