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

Method logout

pkg/server/controllers/users.go:240–255  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

238}
239
240func (u *Users) logout(r *http.Request) (bool, error) {
241 key, err := GetCredential(r)
242 if err != nil {
243 return false, pkgErrors.Wrap(err, "getting credentials")
244 }
245
246 if key == "" {
247 return false, nil
248 }
249
250 if err = u.app.DeleteSession(key); err != nil {
251 return false, pkgErrors.Wrap(err, "deleting session")
252 }
253
254 return true, nil
255}
256
257// Logout handles logout
258func (u *Users) Logout(w http.ResponseWriter, r *http.Request) {

Callers 2

LogoutMethod · 0.95
V3LogoutMethod · 0.95

Calls 2

DeleteSessionMethod · 0.80
GetCredentialFunction · 0.70

Tested by

no test coverage detected