As of right now, we don't actually do anything with the token. But at
least we're actually able to get it. 😅
Caveats in implementation:
- UI now needs a pointer to player
- .env is now required for server auth (mentioned in README.md)
The title says most of it. For authentication, the token gotten from the POST
method can be put as a 'Token' header. It's then validated before being used.
Other changes caused by this update are:
- Fixed a bug where the creation token was unusable due to lacking the
user password hash
- Changed the signing method to HMAC, requiring a string for encryption
This is mentioned in the README.md
The player.go and ui.go files have been separated into their own
separate packages.
Additionally, all go.mod files have been modified to point to local
directories.
This change should not only clean up the frontend codebase, but also
make it easier to send/recieve data from the backend (at least
regarding the player)
Introducing a unified signup and login API. You can post to the /user
route with credentials (so far just name and password), and if the user
doesn't exist, we create the user and return a token. If the user does
exist, if the password inputted matches the database password, we return
a token for that user, else we return an error.
i've never wanted to kms more during a programming session
Player has health, level, exp (which is gained constantly while online)
and ambition (which affects the rate of exp gain). More stats will be
added later. This is mostly just a test implementation. Will clean up
later.
- Moved user interface code to seperate file
- Added a simple wrapper over ebitenui.UI to allow storage of colors
and such
Hopefully this makes it possible for colors to be changed by users in
the future
Player has health, level, exp (which is gained constantly while online)
and ambition (which affects the rate of exp gain). More stats will be
added later. This is mostly just a test implementation. Will clean up
later.
- moved ui code to seperate file
- added a simple wrapper over ebitenui.UI to allow storage of colors
and such
Hopefully this makes it possible for colors to be changed by users in
the future