From 8d280b24afaaa1e05c60414340f598957bc65d5d Mon Sep 17 00:00:00 2001 From: andrea-grapl <64504029+andrea-grapl@users.noreply.github.com> Date: Thu, 16 Jul 2020 17:04:13 -0400 Subject: [PATCH] Reload page when login is successful and history changes. (#148) * added location.reload() when history changes * removed console.logs * removed console.log --- src/js/engagement_view/src/Login.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/engagement_view/src/Login.tsx b/src/js/engagement_view/src/Login.tsx index 268f2906a6..cde7abbb6b 100644 --- a/src/js/engagement_view/src/Login.tsx +++ b/src/js/engagement_view/src/Login.tsx @@ -32,9 +32,9 @@ export const LogIn = (_: LoginProps) => { const loginSuccess = await login(values.userName, password); - if (loginSuccess) { + if (await loginSuccess) { window.history.replaceState('/login', "", "/") - console.log("Logged in"); + window.location.reload(); } else { console.warn("Login failed!") } @@ -43,7 +43,7 @@ export const LogIn = (_: LoginProps) => {


- + @@ -95,7 +95,6 @@ const login = async (username: string, password: string) => { }); const body = await res.json(); - console.log("body", body); return body['success'] === 'True'; } catch (e) { console.log(e);