mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* add endpoint and tests for revoking all sessions for a user * fix failing test build
This commit is contained in:
@@ -901,6 +901,16 @@ func (c *Client4) RevokeSession(userId, sessionId string) (bool, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// RevokeAllSessions revokes all sessions for the provided user id string.
|
||||
func (c *Client4) RevokeAllSessions(userId string) (bool, *Response) {
|
||||
if r, err := c.DoApiPost(c.GetUserRoute(userId)+"/sessions/revoke/all", ""); err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// AttachDeviceId attaches a mobile device ID to the current session.
|
||||
func (c *Client4) AttachDeviceId(deviceId string) (bool, *Response) {
|
||||
requestBody := map[string]string{"device_id": deviceId}
|
||||
|
||||
Reference in New Issue
Block a user