mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-28 18:19:28 +00:00
fix(mcp): serialize hosted oauth reauthorization
This commit is contained in:
parent
b09f1ba770
commit
11eaa77daf
4 changed files with 56 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ class DashboardOAuthFlow:
|
|||
_callback_ready: threading.Event = field(default_factory=threading.Event, init=False, repr=False)
|
||||
|
||||
async def publish_authorization_url(self, url: str) -> None:
|
||||
if self.status in {"approved", "error"}:
|
||||
raise RuntimeError("OAuth flow already ended")
|
||||
state = parse_qs(urlparse(url).query).get("state", [None])[0]
|
||||
if not state:
|
||||
raise ValueError("OAuth authorization URL did not include state")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue