diff --git a/src/sdk/reencrypt.ts b/src/sdk/reencrypt.ts index bb58e8f..6ee4641 100644 --- a/src/sdk/reencrypt.ts +++ b/src/sdk/reencrypt.ts @@ -31,10 +31,14 @@ export const reencryptRequest = const acl = new ethers.Contract(aclContractAddress, aclABI, provider); const userAllowed = await acl.persistAllowed(handle, userAddress); const contractAllowed = await acl.persistAllowed(handle, contractAddress); - const isAllowed = userAllowed && contractAllowed; - if (!isAllowed) { + if (!userAllowed) { throw new Error('User is not authorized to reencrypt this handle!'); } + if (!contractAllowed) { + throw new Error( + 'dApp contract is not authorized to reencrypt this handle!', + ); + } if (userAddress === contractAddress) { throw new Error( 'userAddress should not be equal to contractAddress when requesting reencryption!',