feat: enhance API key normalization and improve Space OAuth callback handling

This commit is contained in:
fdc310
2026-05-11 15:03:30 +08:00
parent ea13ef87f2
commit 6713b57d01
9 changed files with 153 additions and 14 deletions
+8 -1
View File
@@ -14,7 +14,14 @@ class TokenManager:
def __init__(self, name: str, tokens: list[str]):
self.name = name
self.tokens = tokens
self.tokens = []
seen_tokens = set()
for token in tokens:
normalized_token = token.strip() if isinstance(token, str) else ''
if not normalized_token or normalized_token in seen_tokens:
continue
self.tokens.append(normalized_token)
seen_tokens.add(normalized_token)
self.using_token_index = 0
def get_token(self) -> str: