[SOLVED] Metmask Verification + NFT Minter

I am trying to have Metamask connect to your NFT Minter (https://github.com/DanielMoralisSamples/19_MINTNFT) but upon clicking the Connect Wallet, nothing happens. (MM does not connect/pop up)

I attach a screenshot to show successful launch of app. The logic.js contains the correct app ID, server url, and Polygon Mumbai contract (offered in comments). However… Metamask does not appear when button is clicked. (“127.0.0.1:5000. MetaMask is not connected to this site. To connect to a web3 site, find and click the connect button.”)

Is there some inherent connection between the username/email requested and Metamask? Or are they simply generated in the app for the first time?

Thanks so much! Each step = greater expertise…

That demo is using older syntax which may not work now e.g. Moralis.initialize instead of Moralis.start. Check out the v1 docs for what you need to use now.

Also did you update the Moralis CDN script in this file? It needs to now be https://unpkg.com/moralis-v1@latest/dist/moralis.js or using moralis-v1.

Thanks - I’ll try that. What’s the best way to stay abreast of such changes on Moralis projects?

Emails are usually sent out for big breaking changes (for existing projects) if you join the newsletter. Otherwise the Moralis documentation (v1 and 2.0) is typically the best place for up to date info on using Moralis.

If you come across an older Moralis tutorial or project, check the package.json or code and when it was last updated to see if it may need changing.

1 Like

Oh - and the UI’s email/username: they’re being generated here for the first time, correct - and not being recalled / reused from prior work?
D

What do you mean by UI email/username? If you mean the email/username from the current authenticated user, it’s pulled from your Moralis server (where username is auto-generated on user creation and can be changed, and email is optional and can be changed).

I mean this from Daniel’s finished build. I checked the updated lines at his repo, and it seems that your docs and his repo say the same. So that’s all up to date.

As for my email, I clearly know that(!), but I don’t see my username listed anywhere. If I need the username of the current authenticated user, I see more user-information at the old legacy interface, but still not the username.
Thanks in advance!

Those may be two different methods to authenticate, you could choose MetaMask. Probably you can understand from code what happens.

So you mean that “Connect Metamask” in Daniel’s code translates as “Use Metamask username/email”?

I don’t know exactly, you can look in the code to see what happens.

Sadly I don’t see an answer in the code to that question: https://github.com/DanielMoralisSamples/19_MINTNFT

you can try to read here:

I don’t see how that helps me understand which username and password are needed, unfortunately - i.e., from where.

it looks like this code uses them

where did you see password?

so it will accept any new username and email I give it? (Sorry to be dumb.) – because if that’s right, it seems counterintuitive.

I misspoke: I meant username and email

I don’t know on what password you are referring

Correct: I misspoke, that’s my mistake. I meant username and email

it looks like it accepts anything based on that code, the authentication is done with metamask, the username and email are set on the user that is created based on the authentication that is done with metamask, I guess you don’t have to necessarily set that username and email

OK, thanks. I presumed the username was a (small) part of security and ID-protection. It seems not.

That takes me back to my original question from yesterday, then. Why it might be that Metamask does not launch if my logic.js contains the correct app ID, server url, and Polygon Mumbai contract.
When I am on the app page in the browser, Metamask says: “127.0.0.1:5000. MetaMask is not connected to this site. To connect to a web3 site, find and click the connect button.”
… but the connect button does not work :slight_smile: