MCPcopy Create free account
hub / github.com/dnote/dnote / Logout

Method Logout

pkg/server/controllers/users.go:258–272  ·  view source on GitHub ↗

Logout handles logout

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

256
257// Logout handles logout
258func (u *Users) Logout(w http.ResponseWriter, r *http.Request) {
259 var vd views.Data
260
261 ok, err := u.logout(r)
262 if err != nil {
263 handleHTMLError(w, r, err, "logging out", u.LoginView, vd)
264 return
265 }
266
267 if ok {
268 unsetSessionCookie(w)
269 }
270
271 http.Redirect(w, r, "/login", http.StatusFound)
272}
273
274// V3Logout handles logout via API
275func (u *Users) V3Logout(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

logoutMethod · 0.95
handleHTMLErrorFunction · 0.85
unsetSessionCookieFunction · 0.85

Tested by

no test coverage detected