MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / handleSessionDELETE

Method handleSessionDELETE

rest/session_api.go:119–130  ·  view source on GitHub ↗

DELETE /_session logs out the current session

()

Source from the content-addressed store, hash-verified

117
118// DELETE /_session logs out the current session
119func (h *handler) handleSessionDELETE() error {
120 err := h.checkLoginCORS()
121 if err != nil {
122 return err
123 }
124 cookie := h.db.Authenticator(h.ctx()).DeleteSessionForCookie(h.ctx(), h.rq)
125 if cookie == nil {
126 return base.HTTPErrorf(http.StatusNotFound, "no session")
127 }
128 http.SetCookie(h.response, cookie)
129 return nil
130}
131
132// makeSession creates a user session and responds with CouchDB compatible session info.
133func (h *handler) makeSession(user auth.User) error {

Callers

nothing calls this directly

Calls 5

checkLoginCORSMethod · 0.95
ctxMethod · 0.95
HTTPErrorfFunction · 0.92
AuthenticatorMethod · 0.45

Tested by

no test coverage detected