ninegua / reversi

Multiplayer Reversi Game on Internet Computer
https://ninegua.github.io/reversi
MIT License
66 stars 25 forks source link

Managing game accounts #2

Open ninegua opened 4 years ago

ninegua commented 4 years ago

Now that the game is playable on both desktop & mobile, the user experience of switching browsers is not great, because dfx uses browser's localstorage to store user identity (keypairs), and there is no convenient way to use the same identity across different browsers. We need a solution to allow players to log into their accounts, regardless of their devices.

ninegua commented 4 years ago

One solution is to offer user to "lock" account on an existing browser, and then "unlock" it from another one, using a temporary passcode. Of course the passcode has to be entered by the user, and hashed on the client side, before being recorded on the server. This is similar to introducing a password, except that it is temporary, and it maintains the "one device <-> one user" mapping.

An alternative is to support "many devices <-> one user", but still maintain "one device <-> one game". The operation wouldn't be "lock/unlock", but more like "authorize"or something similar. Then the passcode can be automatically generated, or even a QR code.