I’m attempting to test out using the Auth0.js passwordless login. I’m slightly confused as to why I need a redirect_uri (And why this is enforced).
My setup is pretty simple (Code below).
- I would prefer to use my own controls as the Auth0 Lock just isn’t fitting with the rest of our sites design.
- This also means I don’t want to use Auth0 hosted pages.
- Popup is also somewhat off the cards because I think it would be a poor experience on mobile.
So ideally I want a seamless slick JS login. Is this possible using only the JS SDK or do we need to make AJAX calls to our own app and make behind the scenes calls to make it happen.
var webAuth = new auth0.WebAuth({
domain: '',
clientID: '',
redirectUri: '',
responseType: 'token id_token'
});
webAuth.passwordlessStart({
connection: 'email',
send: 'code',
email: $('#login-email').val()
},
function(err, res) {
// handle errors or continue
console.log(err);
console.log(res);
if (err == null) {
$('#login-step-1').hide();
$('#login-step-2').show();
}
}
);
webAuth.passwordlessLogin({
connection: 'email',
email: $('#login-email').val(),
verificationCode: $('#login-verification-code').val()
}, function (err,res) {
// handle errors or continue
console.log(err);
console.log(res);
}
);