summary refs log tree commit diff
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2021-01-19 14:03:39 -0700
committerTravis Ralston <travpc@gmail.com>2021-01-19 14:03:39 -0700
commit7d8cc63e374f088b0cb4dfd7d700e04202f4e749 (patch)
treea1b39a30fd3915edcd1d7677168c853ebe35df40
parentChangelog (diff)
downloadsynapse-7d8cc63e374f088b0cb4dfd7d700e04202f4e749.tar.xz
Get the right requester object
-rw-r--r--synapse/rest/admin/rooms.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py
index 4c0331b197..1d5f6c1807 100644
--- a/synapse/rest/admin/rooms.py
+++ b/synapse/rest/admin/rooms.py
@@ -308,14 +308,15 @@ class RoomStateRestServlet(RestServlet):
     async def on_GET(
         self, request: SynapseRequest, room_id: str
     ) -> Tuple[int, JsonDict]:
-        await assert_requester_is_admin(self.auth, request)
+        requester = await self.auth.get_user_by_req(request)
+        await assert_user_is_admin(self.auth, requester.user)
 
         ret = await self.store.get_room(room_id)
         if not ret:
             raise NotFoundError("Room not found")
 
         room_state = await self.message_handler.get_state_events(
-            user_id=request.requester.user.to_string(),
+            user_id=requester.user.to_string(),
             room_id=room_id,
             is_admin=True,  # already verified above
         )