diff options
author | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2021-12-08 15:01:12 +0000 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2021-12-08 15:01:12 +0000 |
commit | 9551a3ed678e729062194e615074500f44b73ba1 (patch) | |
tree | 589b9b19ef2bcd4cc6699c56ed3a35b23663a99b | |
parent | Remove superfluous lines (diff) | |
download | synapse-9551a3ed678e729062194e615074500f44b73ba1.tar.xz |
Remove early return because we need more logic here
-rw-r--r-- | synapse/api/auth.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 5f7e9163c6..d34d9f8abe 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -327,14 +327,15 @@ class Auth: # This will always be set by the time Twisted calls us. assert request.args is not None - if b"user_id" not in request.args: - return app_service.sender, None, app_service - - user_id = request.args[b"user_id"][0].decode("utf8") - await self.validate_appservice_can_control_user_id(app_service, user_id) - + if b"user_id" in request.args: + effective_user_id = request.args[b"user_id"][0].decode("utf8") + await self.validate_appservice_can_control_user_id( + app_service, effective_user_id + ) + else: + effective_user_id = app_service.sender - return user_id, None, app_service + return effective_user_id, None, app_service async def get_user_by_access_token( self, |