From 86830bbc2f382ff837b1068bd097d5e97c9ec2aa Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 30 Apr 2025 12:43:52 -0600 Subject: refactor: using existing helpers --- pkg/web/cookie/new.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/web') diff --git a/pkg/web/cookie/new.go b/pkg/web/cookie/new.go index cbca724..f4b049e 100644 --- a/pkg/web/cookie/new.go +++ b/pkg/web/cookie/new.go @@ -14,12 +14,12 @@ func New(name, value string, options ...pls.Option[*http.Cookie]) *http.Cookie { With(func(c *http.Cookie) { c.Name = name c.Value = value // TODO:: digitally sign the value - c.Path = "/" - c.HttpOnly = true - c.Secure = true - c.SameSite = http.SameSiteStrictMode - c.Domain = env.Fetch("HOST", "localhost") }), + WithPath("/"), + WithHttpOnly(true), + WithSecure(true), + WithSameSite(http.SameSiteStrictMode), + WithDomain(env.Fetch("HOST", "localhost")), ) return pls.New[*http.Cookie](options...) } -- cgit v1.2.3