From 35e24610aff53861149356f9524ee22cef7a0303 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Wed, 30 Aug 2023 17:29:00 -0300 Subject: [PATCH 1/3] Refactor: Add trim() to login form --- src/frontend/src/pages/loginPage/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/loginPage/index.tsx b/src/frontend/src/pages/loginPage/index.tsx index 14e04708b..c64fc8325 100644 --- a/src/frontend/src/pages/loginPage/index.tsx +++ b/src/frontend/src/pages/loginPage/index.tsx @@ -31,8 +31,8 @@ export default function LoginPage(): JSX.Element { function signIn() { const user: LoginType = { - username: username, - password: password, + username: username.trim(), + password: password.trim(), }; onLogin(user) .then((user) => { From 4739372e201a2b2028c5deb21556cda7f5aa4e7e Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Wed, 30 Aug 2023 17:40:18 -0300 Subject: [PATCH 2/3] Refactor: Add trim() to signUp page --- src/frontend/src/pages/signUpPage/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/signUpPage/index.tsx b/src/frontend/src/pages/signUpPage/index.tsx index 92f3eff97..9a5de5991 100644 --- a/src/frontend/src/pages/signUpPage/index.tsx +++ b/src/frontend/src/pages/signUpPage/index.tsx @@ -33,8 +33,8 @@ export default function SignUp(): JSX.Element { function handleSignup(): void { const { username, password } = inputState; const newUser: UserInputType = { - username, - password, + username: username.trim(), + password: password.trim(), }; addUser(newUser) .then((user) => { From 158ef9a9eab7470eaf0d0d3c16dfbc97f91811bc Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Wed, 30 Aug 2023 17:48:17 -0300 Subject: [PATCH 3/3] Refactor: Remove duplicate login button and bring back button borders back --- .../src/components/headerComponent/index.tsx | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index c74cdaa76..8cbd5a591 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -32,7 +32,8 @@ export default function Header(): JSX.Element { )} {!autoLogin && location.pathname !== `/flow/${tabId}` && ( - { logout(); navigate("/login"); @@ -40,30 +41,20 @@ export default function Header(): JSX.Element { className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary cursor-pointer mx-5" > Sign out - - )} - - {location.pathname === "/admin" && ( - { - navigate("/"); - }} - className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary cursor-pointer" - > - Home - + )} {isAdmin && !autoLogin && location.pathname !== "/admin" && location.pathname !== `/flow/${tabId}` && ( - navigate("/admin")} > Admin page - + )}