fix: restore router Supabase accessor and remove client secret reference

#24
by Baida07 - opened
Files changed (1) hide show
  1. api/state.py +8 -0
api/state.py CHANGED
@@ -69,6 +69,14 @@ def _get_sb() -> Any:
69
  return entry["client"]
70
  return _clients[0]["client"] if _clients else None
71
 
 
 
 
 
 
 
 
 
72
  _sb = _get_sb()
73
 
74
  @router.get("/health")
 
69
  return entry["client"]
70
  return _clients[0]["client"] if _clients else None
71
 
72
+ def sb() -> Any:
73
+ """Return the current Supabase client for router compatibility.
74
+
75
+ Routers use this public accessor so pool rotation and failed-client
76
+ avoidance remain centralized in ``_get_sb``.
77
+ """
78
+ return _get_sb()
79
+
80
  _sb = _get_sb()
81
 
82
  @router.get("/health")