Guys Iām struggling trying to integrate Moralis v2 and let the client communicate with my Parse server database for authenticating users.
Iāve followed this guide:
and
this one:
for the Parse server.
Iām not sure how we can let the client talk with the server in particular here from the MetaMask tutorial:
const { account, chain } = await connectAsync({
connector: new MetaMaskConnector(),
});
const { message } = await requestChallengeAsync({
address: account,
chainId: chain.id,
});
const signature = await signMessageAsync({ message });
and here from the Parse server client
const handleAuth = async () => {
// Connect to Metamask
const { signer, chain, account } = await connectToMetamask();
if (!account) {
throw new Error('No account found');
}
if (!chain) {
throw new Error('No chain found');
}
const { message } = await requestMessage(account, chain);
const signature = await signer.signMessage(message);
const { user } = await verifyMessage(message, signature);
renderUser(user);
};
How could we let the client, from the example of the MetaMask authentication guide, talk to the Parse server we just created?
I think we should use verify and verifyMessage, any example on how to call them from the client?
Thanks