Fix token modal and session token issues

- Fix create token modal z-index so it's not covered by backdrop
- Rename session tokens from "login" to "Web Session" for clarity
- Delete old session tokens when logging in (prevents accumulation)
- Filter out session tokens from dashboard display (users only see
  their manually created API tokens)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
rob
2026-01-13 21:27:01 -04:00
co-authored by Claude Opus 4.5
parent e18a575f76
commit a70267cf53
3 changed files with 14 additions and 6 deletions
+7 -1
View File
@@ -1226,13 +1226,19 @@ def create_app() -> Flask:
[publisher["id"]],
)
# Delete any existing session tokens for this user (cleanup)
g.db.execute(
"DELETE FROM api_tokens WHERE publisher_id = ? AND name = 'Web Session'",
[publisher["id"]],
)
token, token_hash = generate_token()
g.db.execute(
"""
INSERT INTO api_tokens (publisher_id, token_hash, name, created_at)
VALUES (?, ?, ?, ?)
""",
[publisher["id"], token_hash, "login", datetime.utcnow().isoformat()],
[publisher["id"], token_hash, "Web Session", datetime.utcnow().isoformat()],
)
g.db.commit()