# Sign In with Email/Phone Number

## How it works

Users can authenticate using just their email or phone number. On their first time using Cotter, they will be prompted to enter a verification code or press a magic link

{% hint style="success" %}
On subsequent authentication requests through any website, they will be able to **instantly get verified without needing a verification code.**
{% endhint %}

## First Ever Sign Up

On their first ever signup to a website/app that uses Cotter, the user have to enter a verification code.

![First ever signup to a website/app that uses Cotter](https://107069962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0QGDMRD8y_Kd-BpOvT%2F-M9Ly83lRDr19n49iD0A%2F-M9M-J5jm5GYC1L6z5P6%2FWebSDK.png?alt=media\&token=cbf3666c-bd1e-4e17-a000-f623e3d30c34)

#### 1. The user enter their email or phone number

#### 2. They will receive a verification code or magic link to their email or phone number.

The user will then enter the verification code or press the magic link

#### 3. We will return a response in the callback function with the user's email or phone number and a JWT token to verify that the user is authenticated.

{% hint style="success" %}
**✨At this point, we tie the user's browser or device with their email / phone number.** When the user then sign up to another website that uses Cotter, the user **don't need to re-verify their email or phone number.** Instead, our website or SDK will check if we recognize the device with the credentials, and will automatically go to step 3 above.
{% endhint %}

## Subsequent Logins

After the first signup, anytime the user need to sign-up or login to **any website or app that uses Cotter**, the user just needs to enter the email or phone number they want to use, and they'll be **instantly verified**.

![On subsequent logins, the user don't need to enter verification code](https://107069962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0QGDMRD8y_Kd-BpOvT%2F-M9Ly83lRDr19n49iD0A%2F-M9M0Ho0FN1zEdY-5_0K%2FWebSubsequentLogin.png?alt=media\&token=b208c7a7-72ef-48ed-87ca-1f828a1fa081)

#### 1. The user enter their email or phone number

#### 2. The user is already verified, and can continue their registration or login :tada:&#x20;

{% hint style="info" %}
Currently our sessions lasts for 30 days. After 30 days, the user have to re-enter a verification code.

In the near future, we will allow you to check **the last login timestamp** and **decide** whether you'd like to **send another verification code or not**.
{% endhint %}

## Quickstarts

{% content-ref url="broken-reference" %}
[Broken link](https://docs.cotter.app/features/broken-reference)
{% endcontent-ref %}

## Guides

#### Web

{% content-ref url="../sdk-reference/web/web-sdk-verify-email-phone" %}
[web-sdk-verify-email-phone](https://docs.cotter.app/sdk-reference/web/web-sdk-verify-email-phone)
{% endcontent-ref %}

#### React Native

{% content-ref url="../sdk-reference/react-native/react-native-sdk-verify-email-phone" %}
[react-native-sdk-verify-email-phone](https://docs.cotter.app/sdk-reference/react-native/react-native-sdk-verify-email-phone)
{% endcontent-ref %}

#### iOS

{% content-ref url="../sdk-reference/ios/ios-sdk-verify-email-phone" %}
[ios-sdk-verify-email-phone](https://docs.cotter.app/sdk-reference/ios/ios-sdk-verify-email-phone)
{% endcontent-ref %}

#### Android

{% content-ref url="../sdk-reference/android/android-sdk-1" %}
[android-sdk-1](https://docs.cotter.app/sdk-reference/android/android-sdk-1)
{% endcontent-ref %}

#### Other Mobile Apps

{% content-ref url="../sdk-reference/api-for-other-mobile-apps/api-for-mobile-apps" %}
[api-for-mobile-apps](https://docs.cotter.app/sdk-reference/api-for-other-mobile-apps/api-for-mobile-apps)
{% endcontent-ref %}
