fix: 添加 SSO token type 字段

This commit is contained in:
2026-04-09 16:21:22 +08:00
parent c8bffa3961
commit ff8195a594

View File

@@ -108,6 +108,7 @@ def create_access_token(user: dict) -> str:
"sub": str(user["id"]),
"username": user["username"],
"role": user.get("role", "visitor"),
"type": "access", # ← 添加 type 字段用于标识 token 类型
"exp": expire,
"iat": datetime.utcnow()
}