Require logging in to the web UI and API

The first visit to the UI creates the account from a username and password;
after that every API route needs a session cookie from logging in. Accounts
are stored in app_user (Argon2id password hashes) and sessions in
user_session (SHA-256 token hashes, 30 days).

The account page lets the user save a Listenbrainz token, checked with
Listenbrainz first. It takes priority over listenbrainz.token from the
config for LB Radio suggestions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claude BotandClaude Opus 5.5 committed 2026-11-16 19:24:09 +00:00
1 parent 0767c21a6f
commit 53c1bffa6d
33 files changed
+1249 -39

No files matched your search

@@ -0,0 +1,16 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE \"app_user\" SET listenbrainz_token = $1, listenbrainz_user = $2 WHERE id = $3",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar",
"Uuid"
]
},
"nullable": []
},
"hash": "1664ef4607bff9355a30d553780de39ef9883b134c4f1ad97d55ad7c9bead982"
}