diff --git a/frontend/src/app.rs b/frontend/src/app.rs index 3b7e7bd..9c860de 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -26,8 +26,6 @@ pub fn App() -> impl IntoView { Ok(status) => { if !status.completed { log::info!("Setup not completed, redirecting to /setup"); - let navigate = use_navigate(); - navigate("/setup", Default::default()); is_loading.1.set(false); return; } @@ -48,27 +46,12 @@ pub fn App() -> impl IntoView { } is_authenticated.1.set(true); - - let pathname = window().location().pathname().unwrap_or_default(); - if pathname == "/login" || pathname == "/setup" { - log::info!("Already authenticated, redirecting to home"); - let navigate = use_navigate(); - navigate("/", Default::default()); - } } Ok(false) => { log::info!("Not authenticated"); - - let pathname = window().location().pathname().unwrap_or_default(); - if pathname != "/login" && pathname != "/setup" { - let navigate = use_navigate(); - navigate("/login", Default::default()); - } } Err(e) => { log::error!("Auth check failed: {:?}", e); - let navigate = use_navigate(); - navigate("/login", Default::default()); } } @@ -92,10 +75,41 @@ pub fn App() -> impl IntoView {
"404 Not Found"
}> - } /> - } /> + } + } /> + } + } /> @@ -112,6 +126,14 @@ pub fn App() -> impl IntoView { }/> @@ -128,4 +150,4 @@ pub fn App() -> impl IntoView { } -} \ No newline at end of file +}