It looks like you might be using an older version of Auth0.js. In the latest version 9, you should be using the webAuth.passwordlessStart and webAuth.passwordlessLogin methods to get an sms code and verify that code, respectively.
After initializing the webAuth object with:
var webAuth = new auth0.WebAuth({
clientID: '{YOUR_CLIENT_ID}',
domain: '{YOUR_AUTH0_DOMAIN}',
redirectUri: 'http://example.com',
responseType: 'token'
});
You can trigger an sms with:
webAuth.passwordlessStart({
connection: 'sms',
send: 'code',
phoneNumber: '{PHONE NUMBER}'
}, function (err,res) {
// handle errors or continue
}
);
When the sms with the code is received, you’ll be able to verify it with:
webAuth.passwordlessLogin({
connection: 'sms',
phoneNumber: '{PHONE NUMBER}',
verificationCode: '{CODE}'
}, function (err,res) {
// handle errors or continue
}
);
Thank you! Can you say how to disable redirect? Currently I am implementing a mobile app. After authentication, it opens browser. Is it possible to not redirect to browser?