colyseus / colyseus.js

⚔ Colyseus Multiplayer SDK for JavaScript/TypeScript
https://docs.colyseus.io/getting-started/javascript-client/
MIT License
410 stars 107 forks source link

Why token is generated on client side at time of auth? #69

Closed chhaunkar96 closed 4 years ago

chhaunkar96 commented 4 years ago

We can see in the following request that token is going from the client-side with login details. why the token is generated on the client-side?? Can anyone explain it ?? It's confusing.

await client.auth.login();

81102263-02b5f180-8f2d-11ea-8cc3-c84bd7610169

endel commented 4 years ago

Hi @chhaunkar96, this is part of @colyseus/social.

The token is generated in the server. Maybe you had another token from the previous login, that's why you can see the token there as well. @colyseus/social haven't been maintained and improved since a few months - you can use it as inspiration for your own authentication methods, or fork and modify it for your needs