From f351c7013c05506569244c944942a28c58f5b4dd Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 2 Sep 2020 15:41:51 -0700 Subject: [PATCH] hide user info until it's done loading --- src/app/HomePage.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/HomePage.js b/src/app/HomePage.js index fbd428a..061b6ba 100644 --- a/src/app/HomePage.js +++ b/src/app/HomePage.js @@ -76,7 +76,17 @@ function HomePage() { } function UserLoginLogout() { - const { user, isAuthenticated, loginWithRedirect, logout } = useAuth0(); + const { + isLoading, + user, + isAuthenticated, + loginWithRedirect, + logout, + } = useAuth0(); + + if (isLoading) { + return null; + } if (isAuthenticated) { // NOTE: Users created correctly should have these attributes... but I'm