fix: redirect to /workspaces after login (instead of /)
- Local login JS: window.location='/workspaces' instead of '/' - Root route /: if no workspace exists, redirect to /workspaces - Existing users with workspaces: still go to /local-workspace
This commit is contained in:
@@ -369,6 +369,16 @@ async def dashboard(
|
||||
except Exception:
|
||||
pass
|
||||
if not has_gitea:
|
||||
# Check if user has any workspace — if not, send to workspaces
|
||||
try:
|
||||
with get_conn() as conn:
|
||||
ws_count = conn.execute(
|
||||
"SELECT COUNT(*) FROM workspaces WHERE owner_id=?", (user_id,)
|
||||
).fetchone()[0]
|
||||
if ws_count == 0:
|
||||
return RedirectResponse("/workspaces", status_code=302)
|
||||
except Exception:
|
||||
pass
|
||||
return RedirectResponse("/local-workspace", status_code=302)
|
||||
try:
|
||||
repos = await gitea.get_user_repos(page=1, limit=50)
|
||||
|
||||
Reference in New Issue
Block a user