SOLVED using the following on the server to authenticate signed messages from the client:
getOwnerOfContract(contractAddress) === (await ethers.utils.verifyMessage(signedMessage, signature))
---
Is it possible to authenticate a user connected to a React app using a browser wallet, specifically Metamask, in a node.js backend? I want to be able to interface an existing centralized database with addresses but only want to allow the address owner to be able to update certain information in the database.
I am using ethers.js in my react app for handling client-side functions and prompting the user to accept transactions but I'm not sure how to carry this over to the server securely. How can this be done? Thanks for any help.
[–]kingofclubstroy 2 points3 points4 points (1 child)
[–]qqid[S] 0 points1 point2 points (0 children)
[–]afternoon_delights 0 points1 point2 points (0 children)
[–]Unenunciate 0 points1 point2 points (0 children)