feat(account): show the account its own last sign-in

Settings → Account names the latest sign-in on any device (only the
admin's user list did, though the 0.88 notes said otherwise), and the role
in the reader's language instead of the raw `user`.
This commit is contained in:
2026-09-19 04:51:43 +02:00
parent 582c033e1c
commit 373415a2eb
7 changed files with 114 additions and 16 deletions
+10
View File
@@ -95,3 +95,13 @@ def test_the_admin_user_list_carries_last_login(as_user, db, make_user):
assert rows["boss@example.com"]["last_login_at"].startswith("2026-09-16T08:30")
assert rows[never.email]["last_login_at"] is None
def test_the_account_sees_its_own_last_sign_in(client, db, make_user):
# Settings → Account shows it (prod UAT 2026-09-19: only the admin's user list did).
make_user(email="me@example.com", password=_PW)
client.post("/auth/password-login", json={"email": "me@example.com", "password": _PW})
stamp = client.get("/api/me").json()["last_login_at"]
assert _recent(datetime.fromisoformat(stamp))