How to use loginWithPopup() in auth0?

Viewed 478

I am working on a login page (using react) where I want to use loginwithPopup() from auth0. I have used the sample react SPA code from GitHub which is provided by auth0. They have used loginWithRedirect in their example under NavBar component but I want to use loginWithPopup(). for some strange reasons it doesn't work and continuously throws misconfiguration error, however, it works with loginWithRedirect() without any trouble. Can I have a sample working code using loginWithPopup() for auth0 SPA?

const {loginWithPopup } = useAuth0; //useAuth0 from react-auth0-spa.js file
const login = async () => {
        await loginWithPopup({}); // In addition I want to redirect to localhost:3000/homePage
    }

    return (
        <div>
            <button onClick={login}> log in </button>
        </div>
    );
0 Answers
Related