So I have followed exactly what was mentioned in Auth0 SDK quickstart. So the problem is when I log in for the first time I have to refresh the page to see user information. This is my code
nst Profile = () => {
const { user, isAuthenticated, isLoading, getAccessTokenSilently } = useAuth0();
React.useEffect(() => {
if (!isAuthenticated && !isLoading) {
getAccessTokenSilently().then((e) => {
console.log(e);
});
}
}, [isAuthenticated, isLoading]);
So after successful login isAuthenticated
is false
Only after I refresh the page, it becomes true and I get user
object.