diff --git a/README.md b/README.md index 273abc48..f039df7d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ ReactDOM.render( const App = () => { const { login } = useAuth(); - const { authenticated, user } = useAuthState(); + const { authenticated, user, authenticating } = useAuthState(); const handleSignIn = async () => { const { data } = await login({ @@ -70,8 +70,13 @@ const App = () => { } }; + // Important: wait till the authentication process finishes + if (authenticating) { + return
Loading...
+ } + if (authenticated && user) { - return Signed in as {user.firstName}; + return Signed in as {user.email}; } return ;