top of page
2-Factor Authentication Twilio Integration

2-Factor Authentication Twilio Integration

Add 2-factor authentication to your site using the wix-members-2fa-twilio Velo package.

Intermediate.png

Intermediate

823

Published:

December 12, 2021

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example, we used the 2-Factor Authentication Twilio Integration Velo package to add an extra layer of security during the sign-in process, allowing you to verify the identity of a site member logging in to your site. In addition to an email and password, site members must enter a code sent to their phone when logging in. The phone number is associated with the site member during site registration.


For more information about this Velo Package, please see the Readme in the package folder located in the Code Files section of your site.

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It

We installed the Velo package on our site, and followed the steps described in the Setup section of the package’s readme file.


Page Elements



We added a registration and login lightbox to our site. The lightbox contains a multi-state box for switching between registration and login states. The lightbox includes the following elements:


Registration State: Visible Elements


  • 3 text inputs: email, password, phone number

  • dropdown: for selecting a country code

  • submit button

  • text element: links to the login page for site visitors who already registered


Registration State: Collapsed Elements


  • text input: for entering the confirmation code

  • register button

  • 2 text elements: for error messages and for resending the verification code via a phone call


Login State: Visible Elements


  • 2 text inputs: email and password

  • submit button

  • text element: links to a registration page for new site visitors


 Login State: Collapsed Elements


  • text input: for entering the confirmation code

  • login button

  • 2 text elements: for error messages and for resending the verification code via a phone call

 

Code


We added the following code to our lightbox:

  1. Import the initPage() function from the package.

  2. Set aliases for all the page components (elements). Make sure to use the exact alias names used in the init-page.js public package file.

  3. Call the initPage() function with the aliased components.

APIs We Used

Non-code example.

Non-code example.

Non-code example.

Non-code example.

Related Articles

Article Link

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Twilio Integration

Twilio Integration

Integrate with Twilio to make voice calls and send SMS messages

Intermediate.png

Advanced

Twilio SMS Integration

Twilio SMS Integration

Integrate with Twilio to send SMS messages

Intermediate.png

Intermediate

Members Area

Members Area

Custom member signup with email verification.

Intermediate.png

Advanced

Anchor 2

This website was designed with Velo by Wix

bottom of page