Clear cookie on sign out

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-19 12:55:04 +04:00
parent 43c3fd354a
commit ac65c05488
3 changed files with 8 additions and 0 deletions

View File

@@ -34,6 +34,10 @@ func (c *Cookie) Set(w http.ResponseWriter, session *coredata.Session) {
)
}
func (c *Cookie) Clear(w http.ResponseWriter, session *coredata.Session) {
securecookie.Clear(w, c.sessionCookieConfig(time.Until(session.ExpiredAt)))
}
func NewCookie(config *securecookie.Config) *Cookie {
return &Cookie{config}
}

View File

@@ -426,6 +426,9 @@ func (r *mutationResolver) SignOut(ctx context.Context) (*types.SignOutPayload,
return nil, gqlutils.Internal(ctx)
}
w := gqlutils.HTTPResponseWriterFromContext(ctx)
r.sessionCookie.Clear(w, session)
return &types.SignOutPayload{Success: true}, nil
}