API: get list of users with additional auth info (#17305)

* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* API: get users with auth info and isExternal flag

* fix tests for batch disable users

* Users: refactor /api/users/search endpoint

* Users: use alias for "user" table

* Chore: add BatchDisableUsers() to the bus

* Users: order user list by id explicitly

* Users: return AuthModule from /api/users/:id endpoint

* Users: do not return unused fields

* Users: fix SearchUsers method after last changes

* User: return auth module as array for future purposes

* User: tests for SearchUsers()

* User: return only latest auth module in SearchUsers()

* User: fix JOIN, get only most recent auth module
This commit is contained in:
Alexander Zobnin
2019-06-25 18:29:07 +03:00
committed by GitHub
parent 40708bef10
commit dad894f1cc
4 changed files with 107 additions and 21 deletions
+5
View File
@@ -28,6 +28,11 @@ func getUserUserProfile(userID int64) Response {
return Error(500, "Failed to get user", err)
}
getAuthQuery := m.GetAuthInfoQuery{UserId: userID}
if err := bus.Dispatch(&getAuthQuery); err == nil {
query.Result.AuthModule = []string{getAuthQuery.Result.AuthModule}
}
return JSON(200, query.Result)
}