Skip to content

Commit

Permalink
Validate stored signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsm412 committed Aug 23, 2024
1 parent 21fac16 commit d203464
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rair-node/bin/integrations/ethers/web3Signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const recoverUserFromSignature = async (challenge, signature) => {
// Validates that a challenge is correct.
async function checkChallenge(challenge, sig) {
const recovered = await recoverUserFromSignature(challenge, sig);
if (!recovered) {
return false;
}
const storedChallenge = cache.get(recovered.toLowerCase());
if (storedChallenge === challenge) {
cache.del(recovered);
Expand Down

0 comments on commit d203464

Please sign in to comment.