Refusal to authenticate me after server restart

I’m going through this tutorial but I can only logged in once. Even after I changed by wallet on Metamask, I couldn’t. So I went to delete some rows from Moralis db - User, Roles and Session tables.

After that I restarted the Moralis server. But now I’m getting this error on my Chrome console.

moralis.js:25496 POST https://xksxvu7uor5r.usemoralis.com:2053/server/functions/getPluginSpecs 400
dispatch @ moralis.js:25496
ajax @ moralis.js:25503
(anonymous) @ moralis.js:25610
Promise.then (async)
request @ moralis.js:25604
run @ moralis.js:430
run @ moralis.js:356
(anonymous) @ moralis.js:5957
tryCatch @ moralis.js:44124
invoke @ moralis.js:44355
(anonymous) @ moralis.js:44180
asyncGeneratorStep @ moralis.js:28222
_next @ moralis.js:28244
(anonymous) @ moralis.js:28251
Wrapper @ moralis.js:35647
(anonymous) @ moralis.js:28240
(anonymous) @ moralis.js:6051
(anonymous) @ moralis.js:9749
tryCatch @ moralis.js:44124
invoke @ moralis.js:44355
(anonymous) @ moralis.js:44180
asyncGeneratorStep @ moralis.js:28222
_next @ moralis.js:28244
(anonymous) @ moralis.js:28251
Wrapper @ moralis.js:35647
(anonymous) @ moralis.js:28240
(anonymous) @ moralis.js:9764
(anonymous) @ web3-connector.js:20
moralis.js:28290 Uncaught (in promise) Error: Invalid session token
    at handleError (moralis.js:25632:17)

Seems like I can’t connect at all anymore. How do I fix this?

Hey @qwerty

Please provide us your full code

I killed the server and recreated a new one and now my code is working.

I’m following this code below from your tutorial. But what if there’s no Metmask installed. I tried by disabling my Metamask and when I click on “login” it doesn’t throw any error and nothing happens.

The reason I’m asking is that I wish to generate a new wallet for my user if they don’t already have Metamask or others installed. So, I wanna detect the existence of Metamask.

Nvm, I think I got it. Thanks a lot @Yomoo

1 Like