mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 02:42:31 +00:00
Update synapse/rest/client/rendezvous.py
Co-authored-by: Erik Johnston <erikj@element.io>
This commit is contained in:
1 parent
5e8323d88b
commit
cb695d455e
1 file changed
+5
-6
@@ -102,12 +102,11 @@ class MSC4388CreateRendezvousServlet(RestServlet):
|
||||
refreshing rather than that server policy does not permit it to create
|
||||
a session.
|
||||
"""
|
||||
if self.auth.has_access_token(request):
|
||||
# This will raise if the token is invalid or needs a refresh
|
||||
await self.auth.get_user_by_req(request)
|
||||
return True
|
||||
|
||||
return not self.require_authentication
|
||||
requester = await self.auth.get_optional_user_by_req(request)
|
||||
|
||||
# Creation is allowed if authenticated or authentication isn't
|
||||
# required
|
||||
return requester is not None or not self.require_authentication
|
||||
|
||||
async def on_GET(self, request: SynapseRequest) -> tuple[int, Any]:
|
||||
await self._requests_ratelimiter.ratelimit(
|
||||
|
||||
Reference in new issue
Block a user