diff options
Diffstat (limited to 'app/controllers/sessions/controller.go')
| -rw-r--r-- | app/controllers/sessions/controller.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/sessions/controller.go b/app/controllers/sessions/controller.go index b9240c6..50aac63 100644 --- a/app/controllers/sessions/controller.go +++ b/app/controllers/sessions/controller.go @@ -4,6 +4,7 @@ import ( "net/http" "time" + xcookie "github.com/xlgmokha/x/pkg/cookie" "github.com/xlgmokha/x/pkg/log" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc" @@ -37,8 +38,8 @@ func (c *Controller) New(w http.ResponseWriter, r *http.Request) { http.SetCookie(w, cookie.New( "oauth_state", nonce, - cookie.WithSameSite(http.SameSiteLaxMode), - cookie.WithExpiration(time.Now().Add(10*time.Minute)), + xcookie.WithSameSite(http.SameSiteLaxMode), + xcookie.WithExpiration(time.Now().Add(10*time.Minute)), )) http.Redirect(w, r, url, http.StatusFound) } @@ -138,7 +139,7 @@ func (c *Controller) Create(w http.ResponseWriter, r *http.Request) { return } - http.SetCookie(w, cookie.New("session", encoded, cookie.WithExpiration(tokens.Expiry))) + http.SetCookie(w, cookie.New("session", encoded, xcookie.WithExpiration(tokens.Expiry))) http.Redirect(w, r, "/dashboard", http.StatusFound) } |
