Retro Bulletin Board Systems on atproto. Web app and TUI. lazy mirror of alyraffauf/atbbs atbbs.xyz
forums python tui atproto bbs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

tui/local_server: add oauth timeout

+7 -2
+7 -2
tui/local_server.py
··· 5 5 from aiohttp import web 6 6 7 7 8 - async def wait_for_callback(port: int = 23847) -> dict: 8 + async def wait_for_callback(port: int = 23847, timeout: float = 90.0) -> dict: 9 9 """Start a local server and wait for the OAuth callback. 10 10 11 11 Returns dict with 'code', 'state', and 'iss' from the callback query params. ··· 39 39 ) from e 40 40 41 41 try: 42 - await event.wait() 42 + try: 43 + await asyncio.wait_for(event.wait(), timeout=timeout) 44 + except asyncio.TimeoutError: 45 + raise RuntimeError( 46 + f"Timed out waiting for OAuth callback after {int(timeout)}s." 47 + ) from None 43 48 finally: 44 49 await runner.cleanup() 45 50