mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-03 04:03:09 -06:00
Auth API
This commit is contained in:
parent
080f22ac6b
commit
3d757f9f6a
|
|
@ -121,14 +121,7 @@ func Setup(
|
||||||
}
|
}
|
||||||
|
|
||||||
dendriteAdminRouter.Handle("/admin/evacuateRoom",
|
dendriteAdminRouter.Handle("/admin/evacuateRoom",
|
||||||
httputil.MakeExternalAPI("admin_evacuate_room", func(req *http.Request) util.JSONResponse {
|
httputil.MakeAuthAPI("admin_evacuate_room", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
device, err := getSenderDevice(context.Background(), userAPI, cfg)
|
|
||||||
if err != nil {
|
|
||||||
return util.JSONResponse{
|
|
||||||
Code: http.StatusForbidden,
|
|
||||||
JSON: jsonerror.Forbidden("Couldn't determine if you were an admin or not."),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if device.AccountType != userapi.AccountTypeAdmin {
|
if device.AccountType != userapi.AccountTypeAdmin {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue