Registering New User Through Twilio Plugin Returns 'Transaction is not valid'

Hello,

In my project with app id 8149FCCE-07DA-F988-FFBB-6154872C9500 I am calling the Javascript SDK “register” function to onboard new users. I have configured the backend to use the Users.phoneNumber column as the identity column, which is all working fine. If I create users in the console, they can log in using the phone number as expected.

I call “register” passing only the 10-digit phone number and get a nice transactionId in return. I get a verification code on my phone just fine. Then I call “register” again passing:

{
    password: "new password"
    phoneNumber: "same value passed in first register call (triple-checked)"
    transactionCode: "103xx"  // from phone
    transactionId: "SMd740389c283e46ecb83601af08a3xxxx" // saved from first call
}

The POST returns a 400 Bad Request, and the only error is the string “Transaction is not valid”. I’ve tried with, and without, email (I really don’t want to ask users for email).

I’m not sure what, if anything, I’m doing wrong. One thing to look at - before using phone number login and Twilio, I had added a “phone” column to my Users table. When I switched to phone number authentication, I had problems, which were solved by renaming it to phoneNumber. I have triple-checked that it is indeed the identity column. Not sure if that matters.

Thank you!

Kelly

Hello @Kelly_Oglesby,

you are doing everything ok, but the transaction lifetime is only 60 seconds, so after you make an initial call “register” you (your users) have 60 seconds to make a call with transactionCode, password and transaction ID.

Regards,
Stanislaw

We are going to change this limit and raise it to 540 seconds

Well, that worked, but it raises issues.

  1. Is the timeout setable? All of my tests must have taken longer than 60 seconds because I am slow with phone - accessibility issues. I also have garbage internet and cell service - it took 40 seconds to receive the verification code.

  2. It still failed on the first attempt with the error “email field is required”. I hard-coded one just to give myself time to get and type in the code, then it worked. Can this be relaxed, or can I use a single bogus email address for everyone just to get around it? I’m using the phoneNumber identity because I am not using email in this app and historically, only about 20% of my users have an email address. This app is used to speed up user onboarding - requiring users to go get an email address and learn how to use it would completely negate the reason for having the app, so it is kind of a deal killer.

Thank you, Stanislaw.
Kelly

PS - Sorry, I didn’t see your second reply until this posted.

I totally understand and fully agree with you.
We have an internal ticket to make this limit larger (BKNDLSS-24542) and you will be hearing from us as soon as it released.
Whenever you’d like to get a status update for the ticket, please let us know.

As for the email issue, there is a ‘Not Null’ constraint on this column is set which makes this column required. Just remove NN or even delete this column at all if you don’t need it.

Regards,
Stanislaw

Perfect! So happy…

Hi @Kelly_Oglesby,

we have increased the verification code TTL to 540 seconds.
Could you please check it and let us know if it works for you now?
Thanks!

Regards,
Stanislaw

I wait 8 min 55 seconds for the second register call and it worked perfectly. Amazing support, thank you!