I am using AUTH0 V9 API to host the login page on my website and use API to login user via AUTH0. I am using Auth0.js v9 Reference document as a reference. I installed the auth0-js npm package via the following command
npm install auth0-js
Then initialized the AUTH0 via the following code
<script type="text/javascript">
var webAuth = new auth0.WebAuth({
domain: 'YOUR_DOMAIN',
clientID: 'YOUR_CLIENT_ID'
redirectUri: "http://localhost:3000/login",
responseType: "code",
responseMode: "form_post",
scope: "openid profile email",
});
</script>
Then I using login() method as following
webAuth.login({
realm: 'tests',
username: 'testuser',
password: 'testpass',
});
But this above login code is not working. It’s redirecting me to some other URL and not to “http://localhost:3000/login” which I provided while initializing AUTH0 object.
This method also has a reference to “Custom Domain”. Do I need to purchase AUTH0 subscription for managing V9 API or I am doing something wrong that’s why I am getting the wrong redirect. Please help.