diff --git a/app/routers/dashboard.py b/app/routers/dashboard.py index 922afda..e7bb230 100644 --- a/app/routers/dashboard.py +++ b/app/routers/dashboard.py @@ -304,6 +304,20 @@ async def dashboard( auth = _get_user_or_redirect(request) if isinstance(auth, RedirectResponse): return auth + # Check if user has Gitea connected — if not, show local workspace + user_id = auth.get("id") if isinstance(auth, dict) else 1 + has_gitea = False + try: + with get_conn() as conn: + tok = conn.execute( + "SELECT access_token FROM user_oauth_tokens WHERE user_id=? AND provider='gitea'", + (user_id,), + ).fetchone() + has_gitea = bool(tok) + except Exception: + pass + if not has_gitea: + return RedirectResponse("/local-workspace", status_code=302) try: repos = await gitea.get_user_repos(page=1, limit=50) if search: diff --git a/app/templates/base.html b/app/templates/base.html index 15c547f..9b58d7d 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -80,6 +80,26 @@ + +
+