classMyComponentextendsComponent { render() { // Access the auth context from the `auth0` prop const { user } = this.props.auth0; return<div>Hello {user.name}!</div> } } // Wrap your class component in withAuth0 exportdefaultwithAuth0(MyComponent);
+
classMyComponentextendsComponent { render() { // Access the auth context from the `auth0` prop const { user } = this.props.auth0; return<div>Hello {user.name}!</div> } } // Wrap your class component in withAuth0 exportdefaultwithAuth0(MyComponent);
Wrap your class components in this Higher Order Component to give them access to the Auth0Context.
Providing a context as the second argument allows you to configure the Auth0Provider the Auth0Context
@@ -39,7 +39,7 @@
When you wrap your components in this Higher Order Component and an anonymous user visits your component
they will be redirected to the login page and returned to the page they we're redirected from after login.
Use the useAuth0 hook in your components to access authentication state (isLoading, isAuthenticated and user) and authentication methods (loginWithRedirect and logout):
Clears the application session and performs a redirect to /v2/logout, using
the parameters provided as arguments, to clear the Auth0 session.
@@ -303,13 +303,13 @@
By default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the
code for a token. In some cases the code might be for something else (another OAuth SDK perhaps). In these
instances you can instruct the client to ignore them eg