Login User (TWILIO plugin) with UI Builder the correct way

Good day

I managed to Login a user using the Twilio SDK on the UI Builder, getting the sms code and successfully authenticated. Now when I take the user to the new screen, how do I keep that user token active? For example, I send through the json object of the user to the next page and when I use the block to get the user roles, I can see one of the roles are NotAuthenticatedUser. Thus I authenticated the user the previous screen and now the user is not authenticated again. Even if I use the set current user token on both pages, still not authenticated.

I am doing something wrong. Could you help me please to do this the correct way?

EDIT: Even right after calling the Login With Code Twilio code block, I get a user JSON object returned. I assume then the user is authenticated? Right after that I use the set current usertoken block to set the user token I received from the Login with Code block. When I then use the get current user roles block, I get again NotAuthenticatedUser as a role. App ID: 725521A2-5598-4241-FFA2-897A0E52B700


Any feedback for me here please?

I have tried Mark’s UI Builder series on YouTube. Login features works excellently when using normal email and password login. I think something is wrong with the Twilio code blocks. Even a user created with the Twilio SDK gets authenticated normally, but contains no user data when using the get current user block. Even when login happens on the same screen, get current user on that screen does not contain any data.

Any help here will be very much appreciated.


Hi, Johan. Your wrote on a weekend, but we don’t always answer on weekends.
I’ve created the inner task for deeper investigation the problem. Our team which works on UIBuilder look into it asap and post here about the result.

Thank you very much!

Any feedback for me on this issue please?

Hello @johan-jurrius,

The related ticket is resolved and will be released shortly after testing.


Thank you very much for the feedback!

Good day. Any ETA on when it will be released? I am having trouble testing the app without this Twilio integration in UI Builder.


Hello @johan-jurrius,

the fix is already implemented and is currently in the QA approval stage. Once it is released, we’ll notify you here.


Thank you

Hi Johan,

Are you aware of a workaround to set the current user using embedded JS code in UI Builder? Here’s how it works:

The Custom Code block has this:


No, I was not aware. Thank you very much for this. Will try it out now.


Thanks Mark. It works for the session. As soon as I refresh the page, data of the user is gone. I suppose this is also what the team is working on to keep a user logged in.

Thanks for the info. For now, I can work with this.


Hello @johan-jurrius

We added a new Codeless block “Set Current User”, which is in the Users API.