diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-07 11:16:45 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-07 11:16:45 -0700 |
| commit | 30d95f0cb026c13a34e138a7263c5ae6096400d6 (patch) | |
| tree | c98d818bcd2a298b7dde71d973a81b3eeda78482 /app/controllers/sessions | |
| parent | 33cbe7654c9e04a9e176c246ae66c7b1e15100cb (diff) | |
chore: log session cookie to understand why it is not being delivered
Diffstat (limited to 'app/controllers/sessions')
| -rw-r--r-- | app/controllers/sessions/controller.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/sessions/controller.go b/app/controllers/sessions/controller.go index 5681f65..564c92d 100644 --- a/app/controllers/sessions/controller.go +++ b/app/controllers/sessions/controller.go @@ -5,6 +5,7 @@ import ( "time" "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" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls" @@ -139,12 +140,14 @@ func (c *Controller) Create(w http.ResponseWriter, r *http.Request) { return } - cookie.Write(w, web.NewCookie( + ck := web.NewCookie( "session", encoded, cookie.WithExpiration(tokens.Expiry), cookie.WithSameSite(http.SameSiteLaxMode), - )) + ) + log.WithFields(r.Context(), log.Fields{"cookie": ck}) + cookie.Write(w, ck) http.Redirect(w, r, "/dashboard", http.StatusFound) } |
