import { useAuth0 } from "@auth0/auth0-react"; function App() { const { isLoading, // Loading state, the SDK needs to reach Auth0 on load isAuthenticated, error, loginWithRedirect: login, // Starts the login flow logout: auth0Logout, // Starts the logout flow user, // User profile } = useAuth0(); const signup = () => login({ authorizationParams: { screen_hint: "signup" } }); const logout = () => auth0Logout({ logoutParams: { returnTo: window.location.origin } }); if (isLoading) return "Loading..."; return isAuthenticated ? ( <>

Logged in as {user.email}

User Profile

{JSON.stringify(user, null, 2)}
) : ( <> {error &&

Error: {error.message}

} ); } export default App;