Updates to session revoking in v4 (#7565)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3e144f82e2
Коммит
affd35071e
14
api4/user.go
14
api4/user.go
@@ -926,7 +926,19 @@ func revokeSession(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := c.App.RevokeSessionById(sessionId); err != nil {
|
||||
var session *model.Session
|
||||
var err *model.AppError
|
||||
if session, err = c.App.GetSessionById(sessionId); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
if session.UserId != c.Params.UserId {
|
||||
c.SetInvalidUrlParam("user_id")
|
||||
return
|
||||
}
|
||||
|
||||
if err := c.App.RevokeSession(session); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user