DELETE /_session logs out the current session
()
| 117 | |
| 118 | // DELETE /_session logs out the current session |
| 119 | func (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. |
| 133 | func (h *handler) makeSession(user auth.User) error { |
nothing calls this directly
no test coverage detected