From 197dded77f70920bb6ea316c929b3368769a14be Mon Sep 17 00:00:00 2001 From: raczu Date: Sun, 23 Jun 2024 16:09:03 +0200 Subject: [PATCH] fix: redirecting after successfully from submition --- Client/reasn-client/apps/web/app/login/action.ts | 3 ++- Client/reasn-client/apps/web/app/register/action.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/reasn-client/apps/web/app/login/action.ts b/Client/reasn-client/apps/web/app/login/action.ts index 8a901da..38194b2 100644 --- a/Client/reasn-client/apps/web/app/login/action.ts +++ b/Client/reasn-client/apps/web/app/login/action.ts @@ -33,8 +33,9 @@ export const loginAction = async ( try { const payload = await login(result.data); setToken(payload); - redirect("/"); } catch (e) { return handleErrorMessage(e); } + + redirect("/"); }; diff --git a/Client/reasn-client/apps/web/app/register/action.ts b/Client/reasn-client/apps/web/app/register/action.ts index c7b6bb7..5594193 100644 --- a/Client/reasn-client/apps/web/app/register/action.ts +++ b/Client/reasn-client/apps/web/app/register/action.ts @@ -55,8 +55,9 @@ export const registerAction = async ( try { await register(RegisterRequestMapper.fromObject(result.data)); - redirect("/login"); } catch (e) { return handleErrorMessage(e); } + + redirect("/login"); };