MCPcopy Create free account
hub / github.com/daodst/chat / LogoutAll

Function LogoutAll

clientapi/routing/logout.go:46–63  ·  view source on GitHub ↗

LogoutAll handles POST /logout/all

(
	req *http.Request, userAPI api.ClientUserAPI, device *api.Device,
)

Source from the content-addressed store, hash-verified

44
45// LogoutAll handles POST /logout/all
46func LogoutAll(
47 req *http.Request, userAPI api.ClientUserAPI, device *api.Device,
48) util.JSONResponse {
49 var performRes api.PerformDeviceDeletionResponse
50 err := userAPI.PerformDeviceDeletion(req.Context(), &api.PerformDeviceDeletionRequest{
51 UserID: device.UserID,
52 DeviceIDs: nil,
53 }, &performRes)
54 if err != nil {
55 util.GetLogger(req.Context()).WithError(err).Error("PerformDeviceDeletion failed")
56 return jsonerror.InternalServerError()
57 }
58
59 return util.JSONResponse{
60 Code: http.StatusOK,
61 JSON: struct{}{},
62 }
63}

Callers 1

SetupFunction · 0.85

Calls 3

ContextMethod · 0.80
PerformDeviceDeletionMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected