From 2f95febf71881d8e4b86aca29f931a5a6c2665c8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 18:54:55 +0000 Subject: [PATCH] fix: correct token_prefix comment to match implementation (12 chars) Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/api/api_tokens.py | 2 +- app/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/api_tokens.py b/app/api/api_tokens.py index 88f05032..eb48bb12 100644 --- a/app/api/api_tokens.py +++ b/app/api/api_tokens.py @@ -131,7 +131,7 @@ async def create_token( """ plaintext = generate_api_token() token_hash_value = hash_token(plaintext) - prefix = plaintext[:12] # "de_" + first 9 random chars + prefix = plaintext[:12] # "de_" prefix + 9 random chars = 12 chars total db_token = ApiToken( owner_id=owner_id, diff --git a/app/models.py b/app/models.py index 9a4ec2bc..687bf3da 100644 --- a/app/models.py +++ b/app/models.py @@ -627,7 +627,7 @@ class ApiToken(Base): # SHA-256 hex digest of the full token value token_hash = Column(String(64), nullable=False, unique=True, index=True) - # First 8 characters of the token for display (e.g. "de_Ab3xY…") + # First 12 characters of the token for display (e.g. "de_Ab3xY7kL…") token_prefix = Column(String(16), nullable=False) # Usage tracking