# "passwordlessVerify" success is not returning anything

**URL:** <https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471>\
**Category:** Get Help\
**Tags:** passwordlessverify\
**Created:** [February 12, 2018, 7:17pm UTC](https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471 "2018-02-12T19:17:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakib23](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@sakib23](https://community.auth0.com/u/sakib23)\
**Post date:** [February 12, 2018, 7:17pm UTC](https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471/1 "2018-02-12T19:17:06Z")

</div>

I am trying to use paswordlessVerify. My code is following:

```
 verifySMSCode(code, callback) {
       this.auth0.passwordlessVerify({
      connection: 'sms',
      phoneNumber: "+88" + this.shareService.getPhoneNumber(),
      verificationCode: code
    }, function (err, res) {
         if (err.statusCode==400) {
        console.log('error'+err.statusCode);
        //console.log('error'+res);
        callback(false);
        
        // Handle error
      } else{
            console.log("if no error, return true"+err.statusCode);
        callback(true);
      }
      // If successful, save the user's token and proceed
    })
    return true   
  }

```

Now if I give valid SMS code, it never goes to else block.  
Please help.

Sakib

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [February 12, 2018, 10:31pm UTC](https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471/2 "2018-02-12T22:31:02Z")

</div>

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
  }
);

```

You can read more about the passwordless login here:  
[https://auth0.com/docs/libraries/auth0js/v9#passwordless-login](https://auth0.com/docs/libraries/auth0js/v9#passwordless-login)  
[https://auth0.com/docs/connections/passwordless/spa-sms/v9](https://auth0.com/docs/connections/passwordless/spa-sms/v9)  
[https://auth0.com/docs/connections/passwordless/regular-web-app-sms/v9](https://auth0.com/docs/connections/passwordless/regular-web-app-sms/v9)

---

<div class="post-metadata">

**Author:** ![sakib23](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@sakib23](https://community.auth0.com/u/sakib23)\
**Post date:** [March 5, 2018, 6:18am UTC](https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471/3 "2018-03-05T06:18:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 13, 2019, 2:44pm UTC](https://community.auth0.com/t/passwordlessverify-success-is-not-returning-anything/9471/4 "2019-08-13T14:44:08Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
