XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix user retrieval logic to raise an error if user is not set in API key validation

f269ea1b
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -1
Modified g4f/api/__init__.py +1 -1
@@ -255,7 +255,7 @@ class Api:
255 255 data = json.loads(decrypt_data(session_key, user_g4f_api_key))
256 256 expires = int(decrypt_data(private_key, data["data"])) + 86400
257 257 user = data.get("user", user)
258 if not data.get("user"):
258 if not user:
259 259 raise ValueError("User not found")
260 260 except Exception as e:
261 261 debug.log(f"Invalid G4F API key '{user_g4f_api_key[:6]}...' for user: '{user}'")