dnsbty / level10

Phoenix LiveView multiplayer card game
https://level10.games
MIT License
70 stars 2 forks source link

set up user accounts for score tracking #79

Closed dnsbty closed 3 years ago

dnsbty commented 3 years ago

This does a ton of stuff. It uses the new mix phx.gen.auth task in the master branch of Phoenix to generate all of the routes needed for authentication. I then styled all of the generated screens using Tailwind to match the current style of the game. It also adds some stuff for storing the IP address of users when they register a new account, and it stores their IP address and user agent whenever they log in so that a list of logged in sessions can eventually be displayed to the user.

Then I updated the game joining and creation logic so that it will use the user in the session information when creating or joining a game rather than generate a random player ID each time someone creates or joins a game. This allowed me to remove the player ID from the URL so that having access to another player's URL will no longer allow you to take over their spot.

And I set up Bamboo for emails. For now this will be used only for auth emails (forgotten passwords, email confirmations, and such), but eventually I hope to use this to build up an email list of people that enjoy playing the game so that they can be notified about new features.