lijim / monks-and-mages

Monks and Mages is a TCG-game built on React and socket.io
https://www.monksandmages.com
MIT License
17 stars 0 forks source link

Feat: use authenticated API calls #398

Closed lijim closed 1 year ago

lijim commented 1 year ago

Alongside https://github.com/lijim/monks-and-mages-db-service/pull/23, this PR sets forth the path for the game to use genuinely authenticated API calls.

Previously, the API calls (e.g. retrieving all decks / deleting a deck) were param-based only (you only needed to send a username param + a deck ID for instance on DELETE saved_decks)

This change adds a cookie-based accessToken (from auth0) to all the headers in axios calls (GET, POST, DELETE) in order to provide an authorization mechanism for the API