Parse Verify Auth with Module Moralis

Hi,
I tried authen parse server from my unity app.
Parse create user is OK but not save ethAddress :(.

const authData = {
                  id: addressLogin,
                  signature: signature,
                  data: message,
                };
await axios
                  .post(
                    process.env.NEXT_PUBLIC_MORALIS_SERVER_URL + '/users',
                    {
                      authData: {
                        moralisEth: authData,
                      },
                    },
                    {
                      headers: headers,
                    }
                  )

Log at parse server data:

authData {
  id: '0x03d3060084a79264761674ba5df5f4127949f283',
  signature: '0x53ad8f1aed502c2d26b118fd09fa367ef9e3f67b62dee53f6f1248f4a28742400db37874ec096d80b51724c3e0bf2d407c570280897ee268d6041b17e7e87f421c',
  data: 'xxx wants you to sign in with your Ethereum account:\n' +
    '0x03D3060084a79264761674ba5df5f4127949f283\n' +
    '\n' +
    'Please sign this message to confirm your identity.\n' +
    '\n' +
    'URI: https://api.ongdia9999.com/server\n' +
    'Version: 1\n' +
    'Chain ID: 1\n' +
    'Nonce: A0jsen1mMvQBYucQ8\n' +
    'Issued At: 2023-02-23T03:37:55.710Z\n' +
    'Expiration Time: 2023-02-23T03:52:55.227Z\n' +
    'Not Before: 2023-02-23T03:37:55.227Z'
}

Hi @vampiregrodon

It seems like I was able to see ethAddress on my dashboard when I test it at my end.
Do you see a way to reproduce this?

Hi @johnversus,

Yes. I just post authData to /users and new account created but ethAddress was empty.

There might be some other internal functions in the sdk that is responsible for updating ethAddress. Not sure if just posting data is the right way to do this.

I would recommend using the authentication function directly.

If I authentication directly via Open popup login is OK. Have ethAddress in my db.

ethAddress just empty when I tried post /users to parse server

1 Like

As I mentioned there might be other internal functions in the SDK that are responsible for updating ethAddress

OK, how to debug function updating ethAdrress. or where can I find document about upadting ethAddress ?

SDK Moralis or Parse Server problem ?

I follow this link: https://docs.moralis.io/authentication-api.
Step 9: Authentication successful. create a local user is OK. But I checked no ethAddress.

You can find the source code for the v1 authentication function here. Check it to understand how ethAddress is set.

Please check this doc on how to add authentication with the parse server. It uses authenticate function to log in.

Thanks @johnversus,

That I will follow docs.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.