From 7ec6c2fe80635509892556dd6e5760afa3ed1046 Mon Sep 17 00:00:00 2001 From: Lyle Keeton Date: Thu, 28 Nov 2024 12:17:55 -0600 Subject: [PATCH 1/2] fix race condition on login --- trading-dashboard/src/Login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trading-dashboard/src/Login.js b/trading-dashboard/src/Login.js index 4760c5dc..3731a0e7 100644 --- a/trading-dashboard/src/Login.js +++ b/trading-dashboard/src/Login.js @@ -21,7 +21,7 @@ const Login = () => { if (response.status === 200 && response.data.access_token) { setToken(response.data.access_token); console.log('Token set, navigating to /'); // Debug log for navigation - navigate('/'); + setTimeout(navigate, 0, "/"); } else { setError('Invalid username or password'); } From 9c5fe9aba5e6db794e6f6e77482de3f84b6e0241 Mon Sep 17 00:00:00 2001 From: Lyle Keeton Date: Thu, 28 Nov 2024 12:39:26 -0600 Subject: [PATCH 2/2] use matching quote style --- trading-dashboard/src/Login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trading-dashboard/src/Login.js b/trading-dashboard/src/Login.js index 3731a0e7..10d02bcb 100644 --- a/trading-dashboard/src/Login.js +++ b/trading-dashboard/src/Login.js @@ -21,7 +21,7 @@ const Login = () => { if (response.status === 200 && response.data.access_token) { setToken(response.data.access_token); console.log('Token set, navigating to /'); // Debug log for navigation - setTimeout(navigate, 0, "/"); + setTimeout(navigate, 0, '/'); } else { setError('Invalid username or password'); }