I'm trying to understand how a user could be authenticated (like a sign in) using MetaMask, similar to how Cryptokitties makes you sign up/login?
From what I understand, we need to have the user sign a message to authenticate the ownership of the private key that generates a user's address. So If I have a web3 instance in my .js file, how can I prompt the user with a metamask login kinda like Cryptokitties?
I have this in my javascript file:
// Is there is an injected web3 instance?
if (typeof web3 !== 'undefined') {
App.web3Provider = web3.currentProvider;
web3 = new Web3(web3.currentProvider);
} else {
// If no injected web3 instance is detected, fallback to Ganache.
App.web3Provider = new web3.providers.HttpProvider('http://127.0.0.1:7545');
web3 = new Web3(App.web3Provider);
}