@@ -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}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user