Compare commits
4 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
643b83ac21 | ||
|
|
90b65240b2 | ||
|
|
69243a5590 | ||
|
|
10262142fc |
@@ -69,6 +69,14 @@ pub fn App() -> impl IntoView {
|
||||
}
|
||||
|
||||
set_is_authenticated.set(true);
|
||||
|
||||
// If user is already authenticated but on login/setup page, redirect to home
|
||||
let pathname = window().location().pathname().unwrap_or_default();
|
||||
if pathname == "/login" || pathname == "/setup" {
|
||||
logging::log!("Already authenticated, redirecting to home");
|
||||
let navigate = use_navigate();
|
||||
navigate("/", Default::default());
|
||||
}
|
||||
} else {
|
||||
logging::log!("Not authenticated, redirecting to /login");
|
||||
let navigate = use_navigate();
|
||||
@@ -80,7 +88,6 @@ pub fn App() -> impl IntoView {
|
||||
}
|
||||
Err(e) => logging::error!("Network error checking auth status: {}", e),
|
||||
}
|
||||
|
||||
set_is_loading.set(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use leptos::*;
|
||||
use leptos_router::*;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use leptos::*;
|
||||
use leptos_router::*;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user