fix(oauth): fallback storage path when /app doesn't exist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
airano
2026-02-17 18:27:38 +03:30
parent 01ea98b20f
commit c619089403

View File

@@ -213,7 +213,8 @@ def get_storage() -> BaseStorage:
storage_type = os.getenv("OAUTH_STORAGE_TYPE", "json") storage_type = os.getenv("OAUTH_STORAGE_TYPE", "json")
if storage_type == "json": if storage_type == "json":
storage_path = os.getenv("OAUTH_STORAGE_PATH", "/app/data") default_path = "/app/data" if Path("/app").exists() else "./data"
storage_path = os.getenv("OAUTH_STORAGE_PATH", default_path)
return JSONStorage(storage_path) return JSONStorage(storage_path)
# Future: Redis support # Future: Redis support