# Frontend Customer Login

Once your customer is successfully registered to your Magento 2 store, they can quickly log in either using OTP or a password.

## Login with OTP

Whenever a customer chooses Login with OTP option, they will be asked to enter the mobile number for verification using OTP.

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FvMHgBF3Q16eTph40U8zW%2Fimage.png?alt=media&#x26;token=29f70b59-4172-40d1-b102-a6a07a8fedcd" alt=""><figcaption></figcaption></figure>

If the mobile number digits do not match the country validation configured by the admin in the backend, it will show an error message.

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FIwVAeyTpzTKc5kXsWnw7%2Fimage.png?alt=media&#x26;token=f5e60af6-076d-4fae-b79b-71e24e9ade5b" alt=""><figcaption></figcaption></figure>

Once the user enters the correct mobile number and clicks on the Send OTP button, they will receive an SMS as well as an email with OTP for login.

**SMS on Mobile Number with OTP for Login**

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FzETn0wom6KZJ63hUMWGl%2Fimage.png?alt=media&#x26;token=6419718f-80f3-4b87-aec6-8721a865445d" alt=""><figcaption></figcaption></figure>

**Login OTP Email**

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FjCkJlS85piBO7XFc1Qkz%2Fimage.png?alt=media&#x26;token=5a3054bf-2caa-4ce0-b410-030e50bbf287" alt=""><figcaption></figcaption></figure>

After entering the OTP, the user needs to click on Verify & Login.

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FOalOQJ4reHrIdvnzNqPT%2Fimage.png?alt=media&#x26;token=05def617-5edb-4d7a-9760-6e93986b1ef1" alt=""><figcaption></figcaption></figure>

In case the OTP verification time is out, the user gets the option to Resend OTP.

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FNmEsuGLf0u9b02dFZ5mu%2Fimage.png?alt=media&#x26;token=57e2324c-c233-4d7b-b0be-5c3845333e63" alt=""><figcaption></figcaption></figure>

Once the OTP is verified, the login is successfully done. The old customer is redirected to the Update Mobile Number section on their My Account page. The Customer Login through OTP is protected by reCAPTCHA to avoid spam sign-in.

## Login with Password

Whenever a customer chooses the Login with Password option, they will be asked to enter their email address/mobile number and password.

**Email & Password**

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FciX2arVuNwGhO5Dmsqhi%2Fimage.png?alt=media&#x26;token=36d12574-dd13-44c0-badd-38486f8d5de3" alt=""><figcaption></figcaption></figure>

**Mobile Number & Password**

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FPt970peiOIrZst30RCRq%2Fimage.png?alt=media&#x26;token=ce446978-53a0-4921-9fd7-7abf57cf6ec0" alt=""><figcaption></figcaption></figure>

Once the login details are entered correctly, the login is successfully done. The old customer is redirected to the Update Mobile Number section on their My Account page.

After successful login, the customer will be notified via email.

<figure><img src="https://807210804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8wMgNeFnYjVGQmgdxMv4%2Fuploads%2FWIc2KhgIa3nwf8PvytwA%2Fimage.png?alt=media&#x26;token=4511c980-5ab1-40af-933a-610deeb72fd2" alt=""><figcaption></figcaption></figure>
