fix: protect dashboard / route with auth check
Dashboard now calls _get_user_or_redirect() before rendering. Unauthenticated users get redirected to /auth/login?provider=local. All sensitive routes now protected: /, /workspace, /accounts/settings
This commit is contained in:
@@ -292,6 +292,9 @@ async def dashboard(
|
|||||||
search: str = Query(default=""),
|
search: str = Query(default=""),
|
||||||
show_archived: bool = Query(default=False),
|
show_archived: bool = Query(default=False),
|
||||||
):
|
):
|
||||||
|
auth = _get_user_or_redirect(request)
|
||||||
|
if isinstance(auth, RedirectResponse):
|
||||||
|
return auth
|
||||||
try:
|
try:
|
||||||
repos = await gitea.get_user_repos(page=1, limit=50)
|
repos = await gitea.get_user_repos(page=1, limit=50)
|
||||||
if search:
|
if search:
|
||||||
|
|||||||
Reference in New Issue
Block a user