mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-08 10:55:31 +02:00
Check room exists when authenticating an event, by asserting they reference a creation event
This commit is contained in:
parent
236245f7d8
commit
ab9e01809d
1 changed files with 8 additions and 0 deletions
|
@ -65,6 +65,14 @@ class Auth(object):
|
||||||
# FIXME
|
# FIXME
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
creation_event = auth_events.get((EventTypes.Create, ""), None)
|
||||||
|
|
||||||
|
if not creation_event:
|
||||||
|
raise SynapseError(
|
||||||
|
400,
|
||||||
|
"Room %r does not exist" % (event.room_id,)
|
||||||
|
)
|
||||||
|
|
||||||
# FIXME: Temp hack
|
# FIXME: Temp hack
|
||||||
if event.type == EventTypes.Aliases:
|
if event.type == EventTypes.Aliases:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue