hide user info until it's done loading

This commit is contained in:
Emi Matchu 2020-09-02 15:41:51 -07:00
parent 8f4bbcdafa
commit f351c7013c

View file

@ -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