Auth which fail from time to time?

Hello,

Is it just me, or do you also have troubles with the Auth.cs plugin?

Sometimes it works perfectly, sometimes I get a 401 from my server (either locally or externally). Both my local and my remote server logs “invalid signature“.

This log seems to come from verify.js lines 126-134:
valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey);
[…]
if (!valid) {
return done(new JsonWebTokenError('invalid signature'));
}

I didn't change anything to my code, my remote host didn't restart the server script for at least two weeks, and when I try even the earliest commits it doesn't solve anything. But when I launch another project I don't work on anymore, the connection succeeds.

I spent quite a lot of time on this. Any help would be appreciated.

Best
Paul

hi @palrogg, which version of @colyseus/social you have installed? cheers!

Hi Endel, thank you for your reply!

I had 0.10.6 and I just upgraded to 0.10.9, no change... But I use Colyseus-unity3d, maybe there's a problem there. Here is the client-side code where the error occurs, in Colyseus/Auth.cs:

screenshot

The error happens at line 271, but I'm wondering if it may be come from the way the device id gets generated... I'll give it a try tomorrow. Cheers!

Update: it didn’t change anything... If someone has a clue, I'd be very grateful!

In my case the issue was related to old Player Prefs conflicting.
try this is Start method :

IEnumerator Start () {
	PlayerPrefs.DeleteAll();
}

It worked, thank you so much! Solved.
I spent so much time on this...