From 5827e976fe1f7ac5aa9123d2167fe80c2d9de1ca Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 15 Mar 2019 11:55:51 +0000 Subject: Fixups --- synapse/api/auth.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'synapse/api') diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 03dd99fcd0..a1593325f6 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -523,6 +523,12 @@ class Auth(object): def get_appservice_by_req(self, request): (user_id, app_service) = self._get_appservice_user_id(request) + if not app_service: + raise AuthError( + self.TOKEN_NOT_FOUND_HTTP_STATUS, + "Unrecognised access token.", + errcode=Codes.UNKNOWN_TOKEN, + ) request.authenticated_entity = app_service.sender return app_service -- cgit 1.5.1