sonda/internal/auth
Repository files (latest commit first)
Filename Latest commit message Latest commit date
tgiachi 52d1828b46 fix(auth): a token stops working when its account is deleted
SQLite gives the highest user id again after that user is deleted, and an access
token lives for minutes, so the token of a deleted user worked as whoever got the
id next (settings, taste, listens, account).

requireAuth now looks the account up after checking the token and refuses it when
the account is gone, has another name, or was created after the token was signed.
The token carries its issue time for this.

Tests: a unit test of every case, and the real scenario on SQLite (delete the
highest id, create another user, the old token gets 401, the new one works).

Closes #30
2026-11-11 19:25:09 +01:00
..
auth_test.go feat(auth): add refresh tokens, admin role and user management 2026-11-11 12:38:42 +01:00
password.go feat: add sondad server with config, storage, auth and listening API 2026-11-11 12:06:15 +01:00
service.go fix(auth): close session races found in review 2026-11-11 12:45:06 +01:00
service_test.go fix(auth): close session races found in review 2026-11-11 12:45:06 +01:00
token.go fix(auth): a token stops working when its account is deleted 2026-11-11 19:25:09 +01:00