fix: prevent panic on short superadmin secret token prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
HugoCasa
2026-03-13 16:49:18 +01:00
co-authored by Claude Opus 4.5
parent 3d9d35ec04
commit 37ec2e5ad5
+3 -1
View File
@@ -433,7 +433,9 @@ impl AuthCache {
folders: Vec::new(),
scopes: None,
username_override: None,
token_prefix: Some(token[0..TOKEN_PREFIX_LEN].to_string()),
token_prefix: Some(
token.get(..TOKEN_PREFIX_LEN).unwrap_or(token).to_string(),
),
};
Some(OptJobAuthed { authed, job_id: None })
} else {