unity-web3-game-kit icon indicating copy to clipboard operation
unity-web3-game-kit copied to clipboard

Can't update MoralisUser fields after few seconds

Open Zarbuz opened this issue 3 years ago • 2 comments

After logging in via WalletConnect, I can change my MoralisUser's instance information without any problem. However I can't do it anymore after a few seconds, I get an error MoralisSaveException: {"code":206,"error":"Insufficient auth."}.

Example code :

MoralisUser user = await Moralis.GetUserAsync();
user.username = "Test";
await user.SaveAsync();
Debug.Log("Updated user info");

I seem to be missing an essential step? Is there a token that expires after a few seconds?

Zarbuz avatar Aug 01 '22 08:08 Zarbuz

There was a security update on the backend that now re-validates the signature everytime it is posted. I will need to add a patch for this in the Unity SDK.

For now to get past the issue, before you call user.SaveAsync(), clear the authData array. For example:

user.authData.Clear();
await user.SaveAsync();

xactant avatar Aug 24 '22 18:08 xactant

Leaving open as I want to incorporate a solution into the SDK ...

xactant avatar Aug 25 '22 14:08 xactant

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 24 '22 15:10 stale[bot]