I want to create a passwordless authentication (using Metamask to sign a message; then validate the message on the server and then assign a JWT token). I want the part for signing a message to be written inside a vanila javascript file.
Most of the articles I see online are from 2018 and talk about using web3.eth.personal.sign method from web3 which being injected into the browser by Metamask. However I understand this is no longer the case with Metamask. Now that web3 is not injected anymore, what funcitons do I call to sign a message with Metamask?
What I've attempted...
I understand there's a window.ethereum object injected into the browser but I can't seem to find an equivalent function in Metamask Documentaiton for web3.eth.personal.sign
I'm guessing the alternative is to use web3 without window.ethereum but how to I inject this into a vanilla javascript file? Also how do I ensure that the message is signed by Metamask if I just use web3 as standalone?