Merge pull request #1193 from TryQuiet/fix-access-controllers

await verifyIdentity because it's async
This commit is contained in:
Hayden Young
2024-08-24 05:00:54 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ const IPFSAccessController = ({ write, storage } = {}) => async ({ orbitdb, iden
// Allow if the write access list contain the writer's id or is '*'
if (write.includes(id) || write.includes('*')) {
// Check that the identity is valid
return identities.verifyIdentity(writerIdentity)
return await identities.verifyIdentity(writerIdentity)
}
return false
}

View File

@@ -58,7 +58,7 @@ const OrbitDBAccessController = ({ write } = {}) => async ({ orbitdb, identities
// If the ACL contains the writer's public key or it contains '*'
const hasWriteAccess = await hasCapability('write', id) || await hasCapability('admin', id)
if (hasWriteAccess) {
return identities.verifyIdentity(writerIdentity)
return await identities.verifyIdentity(writerIdentity)
}
return false