Logout handles POST /logout
( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, )
| 24 | |
| 25 | // Logout handles POST /logout |
| 26 | func Logout( |
| 27 | req *http.Request, userAPI api.ClientUserAPI, device *api.Device, |
| 28 | ) util.JSONResponse { |
| 29 | var performRes api.PerformDeviceDeletionResponse |
| 30 | err := userAPI.PerformDeviceDeletion(req.Context(), &api.PerformDeviceDeletionRequest{ |
| 31 | UserID: device.UserID, |
| 32 | DeviceIDs: []string{device.ID}, |
| 33 | }, &performRes) |
| 34 | if err != nil { |
| 35 | util.GetLogger(req.Context()).WithError(err).Error("PerformDeviceDeletion failed") |
| 36 | return jsonerror.InternalServerError() |
| 37 | } |
| 38 | |
| 39 | return util.JSONResponse{ |
| 40 | Code: http.StatusOK, |
| 41 | JSON: struct{}{}, |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // LogoutAll handles POST /logout/all |
| 46 | func LogoutAll( |
no test coverage detected