Currently the starter code, does the following when a new player joins. It gets the api token for a player, and if they do not exist in the db, a new player is created.
If they do exist, they are already "known" to the CLOT.
Now consider a scenario where a player has changed his api token(through a password change). This player will always be considered a new player going forward and my CLOT would behave accordingly.
How do I prevent this from happening? Seems like the Player model is a bit incomplete.
How do you handle name changes on Warlight, Fizzer? You must have a different player model surely? What is the unique identifier for a player, given that name, inviteToken(i.e a representation of password) and emailId are all subject to change?
It sounds like you're confusing API token with a player token.
The API token is a secret value. You only ever know your own API token, and should never reveal it to anyone. This changes if you change your password, for security reasons.
The player token uniquely identifies a player and never changes. It's public information -- you'll know your own player token as well as the player token of anyone else.