Telling me I'm not Authenticated when I'm already Authenticated

I’ve attached a couple screenshots, you can see at the top of screenshot #2 where it shows in the console (26) and (4) followed by brackets, that’s the balances and nfts being printed to my console for the wallet that I’m signed in with.

I’m authenticating with Moralis and metamask and then on my checkout page I’m using Moralis.transfer() and this all worked perfectly for weeks and I’ve tested it endlessly, but last night I saw that my checkout button wasn’t working and throwing an error in console that I needed to call Moralis.enabled() or Moralis.authenticate(), but I’m already authenticated and it’s showing my account balances in the same console before it’s giving me that message. If I add Moralis.enable() nothing changes, if I add Moralis.authenticate() it makes me sign in again and then it will let me do the Moralis.transfer() but it’s a confusing to the user and I’m already authenticated so I don’t know why I’m getting this error and needing to do again.

I had this all working perfectly before and I’ve changed nothing in my code, I tried going back to a different previous version of the SDK but I’m getting the issue on all so I’m not sure what changed.

Thanks so much and all the best :slight_smile:

how many versions back did you go with Moralis SDK?

I just went further back, on @0.0.66 it works perfectly and on @0.0.67 and above it stops working and throws the error that’s in the screenshot.

Hey @coinrefill555

What stack do you use?

LAMP, with PHP 7.4.13

Does Moralis.ensureWeb3IsInstalled() work for you after Moralis.enable()?

The Moralis.authenticate() function has Moralis.enable() inside

I’ll try this when I’m back home, thank you.

1 Like