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

Method deleteUserSession

rest/session_api.go:264–272  ·  view source on GitHub ↗

ADMIN API: Deletes a specified session. If username is present on the request, validates that the session being deleted is associated with the user.

()

Source from the content-addressed store, hash-verified

262// ADMIN API: Deletes a specified session. If username is present on the request, validates
263// that the session being deleted is associated with the user.
264func (h *handler) deleteUserSession() error {
265 h.assertAdminOnly()
266 userName := h.PathVar("name")
267 if userName != "" {
268 return h.deleteUserSessionWithValidation(h.PathVar("sessionid"), userName)
269 } else {
270 return h.db.Authenticator(h.ctx()).DeleteSession(h.ctx(), h.PathVar("sessionid"), "")
271 }
272}
273
274// ADMIN API: Deletes all sessions for a user
275func (h *handler) deleteUserSessions() error {

Callers

nothing calls this directly

Calls 6

assertAdminOnlyMethod · 0.95
PathVarMethod · 0.95
ctxMethod · 0.95
DeleteSessionMethod · 0.80
AuthenticatorMethod · 0.45

Tested by

no test coverage detected