diff options
Diffstat (limited to 'pkg/web/cookie.go')
| -rw-r--r-- | pkg/web/cookie.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/web/cookie.go b/pkg/web/cookie.go index d4b1555..1377274 100644 --- a/pkg/web/cookie.go +++ b/pkg/web/cookie.go @@ -9,7 +9,7 @@ import ( ) func NewCookie(name, value string, options ...x.Option[*http.Cookie]) *http.Cookie { - options = x.Prepend[x.Option[*http.Cookie]]( + return x.New[*http.Cookie](x.Prepend[x.Option[*http.Cookie]]( options, cookie.WithName(name), cookie.WithValue(value), // TODO:: digitally sign the value @@ -18,9 +18,7 @@ func NewCookie(name, value string, options ...x.Option[*http.Cookie]) *http.Cook cookie.WithSecure(true), cookie.WithSameSite(http.SameSiteDefaultMode), cookie.WithDomain(env.Fetch("HOST", "localhost")), - ) - - return x.New[*http.Cookie](options...) + )...) } func ExpireCookie(w http.ResponseWriter, name string) { |
