title: Auth0 isAuthenticated is always false
body: <p>I'm using React and I've been following <a href="https://auth0.com/blog/complete-guide-to-react-user-authentication/" rel="nofollow noreferrer">this tutorial</a> on setting up Auth0 for user authentication.</p>
  <p>I've managed to setup a login and logout button, and have been able to connect my web app to the Auth0 universal login page. So far I have signed-up using a gmail and company-based email account, and both have been stored and registered on my Auth0 dashboard. But for some reason, whenever I log in, I'm never actually authenticated and isAuthenticated is always false.</p>
  <p>This is the code I've added from the tutorial:</p>
  <p>My index.js:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import * as serviceWorker from './serviceWorker';
  import { BrowserRouter as Router } from 'react-router-dom';
  import App from './App';
  import Auth0ProviderWithHistory from './components/Authentication/Auth0ProviderWithHistory';
  
  const domain = process.env.REACT_APP_AUTH0_DOMAIN;
  const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;
  
  ReactDOM.render(
      &lt;Router&gt;
      &lt;Auth0ProviderWithHistory&gt;
          &lt;App /&gt;
      &lt;/Auth0ProviderWithHistory&gt;
      &lt;/Router&gt;, document.getElementById('root'));
  
  serviceWorker.unregister();</code></pre>
  </div>
  </div>
  </p>
  <p>Auth0ProviderWithHistory component:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from "react";
  import { useHistory } from "react-router-dom";
  import { Auth0Provider } from "@auth0/auth0-react";
  
  const Auth0ProviderWithHistory = ({ children }) =&gt; {
    const domain = process.env.REACT_APP_AUTH0_DOMAIN;
    const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;
  
    const history = useHistory();
  
    const onRedirectCallback = (appState) =&gt; {
      history.push(appState?.returnTo || window.location.pathname);
    };
  
    return (
      &lt;Auth0Provider
        domain={domain}
        clientId={clientId}
        redirectUri={window.location.origin}
        onRedirectCallback={onRedirectCallback}
      &gt;
        {children}
      &lt;/Auth0Provider&gt;
    );
  };
  
  export default Auth0ProviderWithHistory;</code></pre>
  </div>
  </div>
  </p>
  <p>And my App.js:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { useState } from "react";
  import { Route, Switch, Redirect } from "react-router-dom";
  import Home from "./views/Home/Home";
  import Authenticate from "./views/Authenticate/Authenticate";
  
  const App = () =&gt; {
    return (
      &lt;div&gt;
        &lt;Switch&gt;
          &lt;Route exact path="/Home" render={() =&gt; {
            return (
              &lt;Home /&gt;
            );}}
          /&gt;
          &lt;Route exact path="/Authenticate" render={() =&gt; {
            return (
              &lt;Authenticate /&gt;
            );}}
          /&gt;
        &lt;/Switch&gt;
      &lt;/div&gt;
    );
  };
  
  export default App;</code></pre>
  </div>
  </div>
  </p>
  <p>I'd appreciate any help!</p>