diff --git a/scripts/screenshots.py b/scripts/screenshots.py index 34f1bea..8b99538 100644 --- a/scripts/screenshots.py +++ b/scripts/screenshots.py @@ -8,6 +8,7 @@ Pair it with scripts/ui_demo.py to show the pages with replay data. import sys from pathlib import Path +from playwright.sync_api import TimeoutError as PlaywrightTimeout from playwright.sync_api import sync_playwright PAGES = { @@ -34,9 +35,14 @@ def main(base: str, out: str) -> None: continue page = browser.new_page(viewport=vp, color_scheme=scheme) for name, path in PAGES.items(): - resp = page.goto(base.rstrip('/') + path, wait_until='networkidle') + resp = page.goto(base.rstrip('/') + path, wait_until='domcontentloaded') if resp is None or resp.status >= 400: raise SystemExit(f'{path} answered {resp.status if resp else "nothing"}') + # Web fonts come from Google; in CI that can hang. Give it a moment, then go on. + try: + page.wait_for_load_state('networkidle', timeout=10000) + except PlaywrightTimeout: + pass page.screenshot(path=str(out_dir / f'{name}-{vp_name}-{scheme}.png'), full_page=True) count += 1 page.close() diff --git a/thor/web/mcp.py b/thor/web/mcp.py index ea1fcf4..4025a49 100644 --- a/thor/web/mcp.py +++ b/thor/web/mcp.py @@ -316,7 +316,8 @@ def mcp_post(): try: claims = verify_token(auth[7:].strip(), settings, current_app.config.get('THOR_JWKS')) except AuthError as e: - logger.warning('MCP token refused: %s', e) + # Only the reason is logged (PyJWT's message), never the bearer value itself. + logger.warning('MCP sign-in refused: %s', e) if 'group' in str(e): return jsonify({'error': 'forbidden', 'error_description': str(e)}), 403 return _unauthorized(settings, 'invalid_token', str(e))