diff options
author | Matthew Hodgson <matthew@matrix.org> | 2018-11-03 13:29:36 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2018-11-03 13:29:36 +0000 |
commit | a12e068b389c68a171e1bb3bea9dfa0a3afbca60 (patch) | |
tree | 8c1ea148c63aab7317786f268e10020f7602fb62 /synapse/api/auth.py | |
parent | Merge branch 'dinsic' into matthew/shadow-server (diff) | |
download | synapse-a12e068b389c68a171e1bb3bea9dfa0a3afbca60.tar.xz |
fix deferrs on _get_appservice_user_id and fix default config
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r-- | synapse/api/auth.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index d524ddb4ed..90f9e16bde 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -238,7 +238,6 @@ class Auth(object): errcode=Codes.MISSING_TOKEN ) - @defer.inlineCallbacks def _get_appservice_user_id(self, request): app_service = self.store.get_app_service_by_token( self.get_access_token_from_request( @@ -246,19 +245,19 @@ class Auth(object): ) ) if app_service is None: - defer.returnValue((None, None)) + return(None, None) if app_service.ip_range_whitelist: ip_address = IPAddress(self.hs.get_ip_from_request(request)) if ip_address not in app_service.ip_range_whitelist: - defer.returnValue((None, None)) + return(None, None) if b"user_id" not in request.args: - defer.returnValue((app_service.sender, app_service)) + return(app_service.sender, app_service) user_id = request.args[b"user_id"][0].decode('utf8') if app_service.sender == user_id: - defer.returnValue((app_service.sender, app_service)) + return(app_service.sender, app_service) if not app_service.is_interested_in_user(user_id): raise AuthError( @@ -271,7 +270,7 @@ class Auth(object): # 403, # "Application service has not registered this user" # ) - defer.returnValue((user_id, app_service)) + return(user_id, app_service) @defer.inlineCallbacks def get_user_by_access_token(self, token, rights="access"): |