calaldees / KaraKara

Karaoke Event System - Attendees can view and queue tracks from their mobile phones
https://karakara.uk
GNU General Public License v3.0
28 stars 9 forks source link

`POST login.json` to set admin cookie #114

Closed shish closed 1 year ago

shish commented 2 years ago

Mixing the code for "manage session ID" and "manage is-admin boolean" on the client is hard, and the code for logging in with a password is there already...

Having an API function which accepts this password and sets the admin cookie for us is actually easier than setting the cookie for ourselves, and it's easy to replace with some real authentication if we want to do that in the future.

calaldees commented 1 year ago

Having a place-holder for real authentication sounds sensible. The curl examples in README.md will need updating.

shish commented 1 year ago

The curl examples in README.md will need updating.

At the moment they still work as-is, because "call login.json with the correct password" and "manually change the session_id in your cookie" are the same thing :3