Skip to content

Commit

Permalink
fix: fix redirects on login and signup
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Mar 25, 2024
1 parent 6621adf commit 06f8c6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions crates/site-app/src/pages/auth/login_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn LoginPageInner() -> impl IntoView {

create_effect(move |_| {
if matches!(value(), Some(Ok(true))) {
navigate_to("/dashboard");
navigate_to("/");
}
});

Expand Down Expand Up @@ -166,7 +166,5 @@ pub async fn login(params: LoginParams) -> Result<bool, ServerFnError> {
}

tracing::info!("logged in user: {} ({})", user.name, user.id.0);
leptos_axum::redirect("/");

Ok(true)
}
2 changes: 1 addition & 1 deletion crates/site-app/src/pages/auth/signup_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn SignupPageInner() -> impl IntoView {

create_effect(move |_| {
if matches!(value(), Some(Ok(_))) {
navigate_to("/dashboard");
navigate_to("/");
}
});

Expand Down

0 comments on commit 06f8c6f

Please sign in to comment.