diff --git a/navi/api/routes/auth.py b/navi/api/routes/auth.py index 3e879d1..80bacd2 100644 --- a/navi/api/routes/auth.py +++ b/navi/api/routes/auth.py @@ -223,18 +223,45 @@ @router.get("/mobile-done") async def auth_mobile_done(sid: str) -> Response: - """Bridge page for Android: receives the session id in the URL and - deep-links back into the native app so CookieManager can set the auth - cookie inside the WebView.""" + """Bridge page for Android: attempts an automatic deep-link back into + the native app via Chrome Intent URL, and falls back to a manual button + for browsers that block automatic scheme navigation.""" + intent_url = f"intent://auth/callback?sid={sid}#Intent;scheme=navi;package=com.navi.client;end" + navi_url = f"navi://auth/callback?sid={sid}" html = ( "" - "" - '
Redirecting to app…
" - "" - "" + '' + '' + 'Opening Navi…
' + '' + '