summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2016-01-13 13:19:47 +0000
committerDaniel Wagner-Hall <daniel@matrix.org>2016-01-13 13:19:47 +0000
commit7d09ab891528c16f66fc4adebbafb8134c51f484 (patch)
tree6dc42d8e7b68fd865664e8f997027d43c1c25061 /synapse
parentMerge pull request #482 from matrix-org/markjh/table_name (diff)
downloadsynapse-7d09ab891528c16f66fc4adebbafb8134c51f484.tar.xz
Require AS users to be registered before use
Diffstat (limited to 'synapse')
-rw-r--r--synapse/api/auth.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 876869bb74..e36313e2fb 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -528,6 +528,11 @@ class Auth(object):
                             403,
                             "Application service cannot masquerade as this user."
                         )
+                    if not (yield self.store.get_user_by_id(user_id)):
+                        raise AuthError(
+                            403,
+                            "Application service has not registered this user"
+                        )
 
                 if not user_id:
                     raise KeyError