summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-09-14 17:56:18 +0100
committerErik Johnston <erik@matrix.org>2015-09-14 17:56:18 +0100
commit91cb3b630d09f21144e0f484b3050773e5b2ce93 (patch)
tree86e1a41322b50dda458bab27f244675564df617a /synapse/api
parentDrop unused index (diff)
parentFix tests (diff)
downloadsynapse-91cb3b630d09f21144e0f484b3050773e5b2ce93.tar.xz
Merge pull request #265 from matrix-org/erikj/check_room_exists
Check room exists when authenticating an event
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 0c0d678562..71a955b281 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -65,6 +65,14 @@ class Auth(object):
                 # FIXME
                 return True
 
+            creation_event = auth_events.get((EventTypes.Create, ""), None)
+
+            if not creation_event:
+                raise SynapseError(
+                    403,
+                    "Room %r does not exist" % (event.room_id,)
+                )
+
             # FIXME: Temp hack
             if event.type == EventTypes.Aliases:
                 return True