isAuthenticated Not Working As Per My Expectations


SDK - latest @auth0/auth0-react

Logic having issue:-

  if (!isAuthenticated) {"User is not authenticated..");
return (
    isAuthenticated && <SecretPage/>)

My expectation:-

Since isAuthenticated keeps record of logged in state, I’m expecting that it should logout user automatically once accessToken is expired (given that I’m not using refresh token).

What’s happening:-

isAuthenticated is doing nothing once logged in. User stays logged in and SecretPage component is visible until page is reloaded. isAuthenticated logging out only after refresh of page.

Please help with it.