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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user