diff --git a/rair-node/bin/integrations/ethers/web3Signature.js b/rair-node/bin/integrations/ethers/web3Signature.js index bfc32ef38..f48f3be79 100644 --- a/rair-node/bin/integrations/ethers/web3Signature.js +++ b/rair-node/bin/integrations/ethers/web3Signature.js @@ -168,11 +168,15 @@ module.exports = { } const recovered = await recoverUserFromSignature(MetaMessage, MetaSignature); const storedOwner = cache.get(`${userAddress}secret`); - if (recovered?.toLowerCase() === storedOwner?.toLowerCase()) { + if ( + recovered !== undefined && + storedOwner !== undefined && + recovered.toLowerCase() === storedOwner.toLowerCase() + ) { cache.del(userAddress.toLowerCase()); cache.del(MetaMessage); cache.del(`${userAddress}secret`); - req.metaAuth = { recovered: userAddress }; + req.metaAuth = { recovered: recovered.toLowerCase() }; req.web3LoginMethod = 'web3auth'; } else { req.metaAuth = undefined;