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

Add email link same device/browser setting docs #1044

Merged
merged 7 commits into from
Jun 11, 2024

Conversation

mzhong9723
Copy link
Member

@mzhong9723 mzhong9723 commented May 15, 2024

New documentation for email link require same client setting

  • new page under the security section to explain the new feature and how to enable it
  • update handleEmailLinkVerification() documentation to add info about the new client_mismatch status that will be introduced if this setting is turned on

🔎 Previews:

@mzhong9723 mzhong9723 requested a review from a team as a code owner May 15, 2024 18:30
@mzhong9723 mzhong9723 force-pushed the mz/core-1979-email-link-protection-docs branch from 58ff990 to 345bc19 Compare May 15, 2024 18:32
@mzhong9723 mzhong9723 requested a review from zythosec May 15, 2024 18:32
@clerk clerk deleted a comment from github-actions bot May 15, 2024
Copy link

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

@mzhong9723 mzhong9723 changed the title Add email link same device/browser protection docs [Do not merge yet] Add email link same device/browser protection docs May 15, 2024
Copy link
Contributor

@S3Prototype S3Prototype left a comment

Choose a reason for hiding this comment

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

Well written, thank you!

docs/security/email-link-protection.mdx Outdated Show resolved Hide resolved
docs/security/email-link-protection.mdx Outdated Show resolved Hide resolved
Copy link

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

@mzhong9723 mzhong9723 force-pushed the mz/core-1979-email-link-protection-docs branch from 77c6b6a to ccab59c Compare May 21, 2024 20:07
@mzhong9723 mzhong9723 changed the title [Do not merge yet] Add email link same device/browser protection docs Add email link same device/browser setting docs May 21, 2024
Copy link

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

Copy link

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

@@ -20,7 +20,7 @@ function handleEmailLinkVerification(

When users click on email links they get redirected to the URL that was provided during email link verification flow initialization. The URL will contain a couple of important query parameters added by Clerk. These are called `__clerk_status` and `__clerk_created_session`.

The `__clerk_status` query parameter is the outcome of the verification and can take three values: **verified**, **failed** or **expired**.
The `__clerk_status` query parameter is the outcome of the verification and can take four values: **verified**, **failed**, **expired**, or **client_mismatch**. **client_mismatch** can only be a verification outcome if [Require the same device or browser](/docs/security/email-link-protection) is turned on for sign-ins or sign-ups.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The `__clerk_status` query parameter is the outcome of the verification and can take four values: **verified**, **failed**, **expired**, or **client_mismatch**. **client_mismatch** can only be a verification outcome if [Require the same device or browser](/docs/security/email-link-protection) is turned on for sign-ins or sign-ups.
The `__clerk_status` query parameter is the outcome of the verification and accepts the following values: `verified`, `failed`, `expired`, or `client_mismatch`. `client_mismatch` can only be a verification outcome if the [**Require the same device or browser**](/docs/security/email-link-protection) setting is turned on for sign-ins or sign-ups.

Comment on lines 27 to 31
To configure this security setting, go to [Email, Phone, and Username](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username) section of the Clerk Dashboard.

To enable this protection for sign-ups, go to **Contact information** > **Email address**. Open the modal and make sure **Require the same device and browser** is enabled under the **Email verification link** checkbox.

To enable this protection for sign-ins, go to **Authentication strategies** > **Email verification link**. Ensure **Require the same device and browser** is toggled on in the configuration modal.
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way I can test this in the Dashboard? It's not currently there, and I don't see it in staging either.

Suggested change
To configure this security setting, go to [Email, Phone, and Username](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username) section of the Clerk Dashboard.
To enable this protection for sign-ups, go to **Contact information** > **Email address**. Open the modal and make sure **Require the same device and browser** is enabled under the **Email verification link** checkbox.
To enable this protection for sign-ins, go to **Authentication strategies** > **Email verification link**. Ensure **Require the same device and browser** is toggled on in the configuration modal.
To configure this security setting, navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/email-phone-username) and in the navigation sidebar, select **Email, Phone, Username**.
To enable this protection for **sign-ups**:
1. In the **Contact information** section, next to **Email address**, select the settings icon.
1. Under the **Email verification link** checkbox, ensure **Require the same device and browser** is enabled.
To enable this protection for **sign-ins**:
1. In the **Authentication strategies** section, next to **Email verification link**, select the settings icon.
1. Ensure **Require the same device and browser** is toggled on.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's enabled in staging now! https://clerkinc.slack.com/archives/CHZ1FBBEG/p1717534767333909

I also updated this section a bit. I realized the previous wording was implying the setting could be turned on for sign-ins only, for example, but it's the same setting for both sign-ins and sign-ups. You can't turn it on only for one or the other. Lmk what you think!

@alexisintech alexisintech mentioned this pull request May 24, 2024
@mzhong9723 mzhong9723 marked this pull request as draft May 28, 2024 18:32
@mzhong9723 mzhong9723 force-pushed the mz/core-1979-email-link-protection-docs branch from f9517bd to 5e98405 Compare June 4, 2024 21:10

Authentication strategies section:
1. In the **Authentication strategies** section, next to **Email verification link**, select the settings icon.
2. Ensure **Require the same device and browser** is toggled on.
Copy link
Member

Choose a reason for hiding this comment

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

It's a checkbox instead of a toggle. Not sure why that decision was made - do we want to make those consistent in the Dashboard?

Suggested change
2. Ensure **Require the same device and browser** is toggled on.
2. Ensure **Require the same device and browser** is checked.

In particular, clarify how the require same client
setting will affect email link flows.
Copy link

github-actions bot commented Jun 7, 2024

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

@mzhong9723 mzhong9723 marked this pull request as ready for review June 11, 2024 20:11
@mzhong9723 mzhong9723 merged commit 9fe34c6 into main Jun 11, 2024
3 checks passed
@mzhong9723 mzhong9723 deleted the mz/core-1979-email-link-protection-docs branch June 11, 2024 20:11
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.

5 participants