do not allow to create room with self

This commit is contained in:
Ulf Gebhardt 2023-07-11 11:19:01 +02:00
parent 1ee2dc70bb
commit 073adbe48c
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -32,6 +32,9 @@ export default {
const {
user: { id: currentUserId },
} = context
if (userId === currentUserId) {
throw new Error('Cannot create a room with yourself')
}
const session = context.driver.session()
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
const createRoomCypher = `