From 06f8c6f539ddc23868c896eebf9fff3f8685e40d Mon Sep 17 00:00:00 2001 From: John Lewis Date: Mon, 25 Mar 2024 21:35:33 +0100 Subject: [PATCH] fix: fix redirects on login and signup --- crates/site-app/src/pages/auth/login_page.rs | 4 +--- crates/site-app/src/pages/auth/signup_page.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/site-app/src/pages/auth/login_page.rs b/crates/site-app/src/pages/auth/login_page.rs index 612dd47..7067f76 100644 --- a/crates/site-app/src/pages/auth/login_page.rs +++ b/crates/site-app/src/pages/auth/login_page.rs @@ -98,7 +98,7 @@ pub fn LoginPageInner() -> impl IntoView { create_effect(move |_| { if matches!(value(), Some(Ok(true))) { - navigate_to("/dashboard"); + navigate_to("/"); } }); @@ -166,7 +166,5 @@ pub async fn login(params: LoginParams) -> Result { } tracing::info!("logged in user: {} ({})", user.name, user.id.0); - leptos_axum::redirect("/"); - Ok(true) } diff --git a/crates/site-app/src/pages/auth/signup_page.rs b/crates/site-app/src/pages/auth/signup_page.rs index db05e0d..09f394c 100644 --- a/crates/site-app/src/pages/auth/signup_page.rs +++ b/crates/site-app/src/pages/auth/signup_page.rs @@ -119,7 +119,7 @@ pub fn SignupPageInner() -> impl IntoView { create_effect(move |_| { if matches!(value(), Some(Ok(_))) { - navigate_to("/dashboard"); + navigate_to("/"); } });