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

"code":206,"error":"Insufficient auth."

Open btcgames opened this issue 3 years ago • 5 comments

Get error when using user.SaveAsync();

File UniversalWebClient.cs line 87 try { await webRequest.SendWebRequest(); } catch (Exception exp) { Debug.LogError($"Target: {httpRequest.Target}"); Debug.LogError($"Error: {exp.Message}"); }

Error: HTTP/1.1 400 Bad Request {"code":206,"error":"Insufficient auth."}

btcgames avatar Aug 08 '22 20:08 btcgames

Sometimes I can save the user, but only 1 time.

btcgames avatar Aug 08 '22 20:08 btcgames

I used versions 1.2.1 and 1.2.5

btcgames avatar Aug 08 '22 20:08 btcgames

Seems the same error as me in #118

Zarbuz avatar Aug 08 '22 21:08 Zarbuz

i also get this error when i try to save _User data or custom user class data, save works on other classes like Monster example I can only save user first ~20 seconds from authentication then save breaks

I tried SDK version 1.1.0, 1.2.4 and 1.2.5 Unity version 2020.3.30f1, 2021.1.15f1 and 2021.3.3f1

kappajungle avatar Aug 09 '22 07:08 kappajungle

i also get this error when i try to save _User data or custom user class data, save works on other classes like Monster example I can only save user first ~20 seconds from authentication then save breaks

I tried SDK version 1.1.0, 1.2.4 and 1.2.5 Unity version 2020.3.30f1, 2021.1.15f1 and 2021.3.3f1

Have you solved the problem?

btcgames avatar Aug 22 '22 17:08 btcgames

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();

Do the same for custom data objects.

xactant avatar Aug 24 '22 18:08 xactant

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();

Do the same for custom data objects.

Thank you

btcgames avatar Aug 25 '22 08:08 btcgames

When I implement this fix, it seems to solve the original error posted, but when I subsequently try to retrieve the wallet information, it can't find the eth address, so I get another error: KeyNotFoundException: The given key 'moralisEth' was not present in the dictionary.

SmallMyTable avatar Sep 22 '22 00:09 SmallMyTable