Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update email link custom flow guide #1433

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

update email link custom flow guide #1433

wants to merge 3 commits into from

Conversation

alexisintech
Copy link
Member

@alexisintech alexisintech commented Aug 13, 2024

@alexisintech alexisintech requested a review from a team as a code owner August 13, 2024 16:32
@alexisintech alexisintech marked this pull request as draft August 13, 2024 16:33
Copy link

Hey, here’s your docs preview: https://clerk.com/docs/pr/1433

@@ -125,7 +125,20 @@ If a country is disabled, then phone numbers starting with the corresponding cou

### Email link

When the **Email verification link** option is selected as an authentication strategy, users will receive an email message with a link that can be visited in order to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile. Email links work on any device. There's no constraint on where the link will be opened. For example, a user might try to sign in from their desktop browser, but open the link from their mobile phone.
When the **Email verification link** option is selected as an authentication strategy, users will receive an email message with a link that can be visited in order to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When the **Email verification link** option is selected as an authentication strategy, users will receive an email message with a link that can be visited in order to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile.
When the **Email verification link** option is selected as an authentication strategy, users receive an email message with a link to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to user profiles.

When the **Email verification link** option is selected as an authentication strategy, users will receive an email message with a link that can be visited in order to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile. Email links work on any device. There's no constraint on where the link will be opened. For example, a user might try to sign in from their desktop browser, but open the link from their mobile phone.
When the **Email verification link** option is selected as an authentication strategy, users will receive an email message with a link that can be visited in order to complete the authentication process. Email links can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile.

As a security measure, email links expire after 10 minutes to prevent the use of potentially compromised stale links.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As a security measure, email links expire after 10 minutes to prevent the use of potentially compromised stale links.
As a security measure, email links expire after 10 minutes prevent the use of compromised or stale links.

Comment on lines +138 to +141
1. Navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username).
1. In the navigation sidebar, select **User & Authentication > Email, Phone, and Username**.
1. In the **Authentication strategies** section, next to **Email verification link**, select the settings cog icon.
1. Enable or disable the **Require the same device and browser** setting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username).
1. In the navigation sidebar, select **User & Authentication > Email, Phone, and Username**.
1. In the **Authentication strategies** section, next to **Email verification link**, select the settings cog icon.
1. Enable or disable the **Require the same device and browser** setting.
1. In the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username), navigate to the **User & Authentication > Email, Phone, and Username** page.
1. In the **Authentication strategies** section, next to **Email verification link**, select the settings cog icon.
1. Enable or disable the **Require the same device and browser** setting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we want to not use settings cog icon?


#### Require the same device and browser

By default, email links can work on any device. There's no constraint on where the link can be opened. For example, a user could try to sign in from their desktop browser, but open the link from their mobile phone. In this scenario, _the user's sign in would be completed on the desktop browser from which it was initiated, not the mobile phone where it was verified_. As a result, the user would be signed in on their desktop, not their phone.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default, email links can work on any device. There's no constraint on where the link can be opened. For example, a user could try to sign in from their desktop browser, but open the link from their mobile phone. In this scenario, _the user's sign in would be completed on the desktop browser from which it was initiated, not the mobile phone where it was verified_. As a result, the user would be signed in on their desktop, not their phone.
By default, email links can be opened on any device. There's no restriction on where the link can be accessed. For example, a user could try to sign in from their desktop browser but open the link from their mobile phone. In this case, _the user's sign in would be completed on the desktop browser where the process was initiated, not the mobile phone where the link was verified_. As a result, the user would be signed in on their desktop, not their phone.


## Email link flow
[Email links](/docs/authentication/configuration/sign-up-sign-in-options#email-link) can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Email links](/docs/authentication/configuration/sign-up-sign-in-options#email-link) can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to their profile.
[Email links](/docs/authentication/configuration/sign-up-sign-in-options#email-link) can be used to sign up new users, sign in existing ones, or allow existing users to verify newly entered email addresses to user profiles.

1. Navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username).
1. In the navigation sidebar, select **User & Authentication > Email, Phone, and Username**.
1. In the **Contact information** section, **Email address** should be enabled.
1. In the **Username** section, ensure that **Username** is not required, or else the `create()` method will require a username to be passed in the params. If you would like to use usernames, you must handle collecting the username in your custom flow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. In the **Username** section, ensure that **Username** is not required, or else the `create()` method will require a username to be passed in the params. If you would like to use usernames, you must handle collecting the username in your custom flow.
1. In the **Username** section, ensure that **Username** is not required. Otherwise, the `create()` method will require a username to be passed in the params. If you want to use usernames, you must handle collect the username in your custom flow.

1. In the **Contact information** section, **Email address** should be enabled.
1. In the **Username** section, ensure that **Username** is not required, or else the `create()` method will require a username to be passed in the params. If you would like to use usernames, you must handle collecting the username in your custom flow.
1. In the **Authentication strategies** section, toggle on **Email verification link**.
1. Keep this page open as you will need to enable email link verification in the next step.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Keep this page open as you will need to enable email link verification in the next step.
1. Keep this page open to enable email link verification in the next step.


If you click on the **Settings cog** icon next to **Email address**, the email address configuration screen will pop open. You can toggle on **Require** if you want to make sure that all users have an email address associated with their profile.
1. On this same page in the Clerk Dashboard, next to **Email address**, select the settings cog icon. A modal will open.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question for settings cog icon.


If you click on the **Settings cog** icon next to **Email address**, the email address configuration screen will pop open. You can toggle on **Require** if you want to make sure that all users have an email address associated with their profile.
1. On this same page in the Clerk Dashboard, next to **Email address**, select the settings cog icon. A modal will open.
1. Under **Verification methods**, enable the **Email verification link** option. For the sake of this guide, uncheck the box for **Email verification code**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Under **Verification methods**, enable the **Email verification link** option. For the sake of this guide, uncheck the box for **Email verification code**.
1. Under **Verification methods**, enable the **Email verification link** option. For this guide, uncheck the box for **Email verification code**.


> [!NOTE]
> **Verification methods** are different from **Authentication strategies**. **Verification methods** are used for verifying a user's identifier, such as an email address upon initial sign-up or when updating their profile. **Authentication strategies** are used for authenticating a user, such as when they are signing in to your application.
The flow for handling email links is the same across all scenarios. You must:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The flow for handling email links is the same across all scenarios. You must:
The flow for handling email links is the same across all use cases. You must:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants