[SOLVED] Issue with login for a new user Moralis v1

Hi I’ve just updated to the 1.11 and also installed the package moralis-v1

Now trying to login with a new wallet address that is not available in the database, the user is not logged and on the database it creates a new row but with fields “ethAddress” and “accounts” as undefined.

I didn’t change the login system, anyone knows what is happening?

Thank you

you are using vanilla js, react, something else?

do you see any error in the browser console/network tab?

react, next.js

the only error in console when I try to login with a new user is an error 400 from the server

Failed to load resource: the server responded with a status of 400 ()

and if I see the database the user is created but both ethAddress and accounts are (undefined) and the login doesn’t work.

Only for new users after the update

did you change anything in the User class, like adding new columns and restrictions?

you can also check the parameters for that request that returns 400 status code to see if everything looks like expected

No I didn’t change the user class, just updated to moralis 1.11 and added the package moralis-v1

If I login with an already existing user everything is working.

Is there any change to the login part of Moralis with the 1.11 that I should care about?

I don’t know of a change that could cause that, you could also post the server url
if you evert back to an older version of Moralis SDK then it works without problems?

if you delete a user you also have to delete the eth address for EthAddress table, in case that you deleted some users from the database

with an older version, the 1.10.1 it works properly, we didn’t change manually the DB table removing users so I would exclude that cause

do you see any difference in network tab in browser for the parameters sent when the request works and it doesn’t work?

if version 1.10.1 works for you then you can use that version

any specific difference in network tab. In my opinion it would not be a solution to use an older version just because it’s working, and in any case, the issue and the need to update to 1.11 and also to add moralis-v1 as package was an error with vercel when building on production, and there was the requirement for moralis-v1 package that didn’t found, and the build failed

So if I go back to the 1.10.1 we have a build issue in production

You asked for the url of the server, is that of any help to identify the issue?

I didn’t look yet on the server yet, you can look in network tab to see how a request that works looks like compared to one that doesn’t work.

I think that you should be able to specify exact versions for a package

I found this in error logs:

Error: Permission denied for action create on class _EthAddress.

Is that standard to have only read on that class? or is required the public write?

try to add write to see if it works after that, it will need write to add data there, same for User class, User class also has public Write needed to add new users

Yes User class already had it, it was not on EthAddress class, now adding it, works. Really strange thing is that we were testing before of it with new users and it was working, it didn’t after the update and we thought it was related to it.

I see in any case that there is the ACL for that class so it’s safe to have public write also.

Ok thank you it seems solved now

1 Like