Skip to content

Commit

Permalink
feat: Legal consent (#1671)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexis Aguilar <[email protected]>
Co-authored-by: victoria <[email protected]>
  • Loading branch information
3 people authored Nov 11, 2024
1 parent 99ccf10 commit 95da7d2
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/authentication/configuration/legal-compliance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Legal compliance
description: Learn how to configure your legal compliance settings in the Clerk Dashboard.
---

Clerk provides a legal compliance setting that allows you to require users to agree to your terms of service or privacy policy before they can sign up to your application. After enabling the setting, there will be a checkbox to accept the terms in your [`<SignUp />` component](/docs/components/authentication/sign-up) or [Account Portal sign-up page](/docs/customization/account-portal/overview#sign-up).

To configure the setting:

1. In the Clerk Dashboard, navigate to the [**Legal**](https://dashboard.clerk.com/last-active?path=compliance/legal) page.
1. Enable or disable **Require express consent to legal documents**.
4 changes: 4 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@
{
"title": "Restrictions",
"href": "/docs/authentication/configuration/restrictions"
},
{
"title": "Legal compliance",
"href": "/docs/authentication/configuration/legal-compliance"
}
]
]
Expand Down
35 changes: 35 additions & 0 deletions docs/references/javascript/sign-up/authenticate-with.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi
- `string | undefined`

Email address to use for targeting a SAML connection at sign-up.

---

- `legalAccepted?`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

## `authenticateWithWeb3()`
Expand Down Expand Up @@ -89,6 +96,13 @@ function authenticateWithWeb3(params: AuthenticateWithWeb3Params): Promise<SignU
- `Web3Strategy`

The Web3 verification strategy.

---

- `legalAccepted?`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

### `GenerateSignatureParams`
Expand All @@ -112,6 +126,13 @@ function authenticateWithWeb3(params: AuthenticateWithWeb3Params): Promise<SignU
- `Web3Provider`

The Web3 provider to generate the signature with.

---

- `legalAccepted?`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

## `authenticateWithMetamask()`
Expand All @@ -131,6 +152,13 @@ function authenticateWithMetamask(
- `{[string]: any}`

Custom fields that will be attached to the [`User`](/docs/references/javascript/user/user) object post-signup.

---

- `legalAccepted?`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

## `authenticateWithCoinbaseWallet()`
Expand All @@ -150,6 +178,13 @@ function authenticateWithCoinbaseWallet(
- `{[string]: any}`

Custom fields that will be attached to the [`User`](/docs/references/javascript/user/user) object post-signup.

---

- `legalAccepted?`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

[signup-ref]: /docs/references/javascript/sign-up/sign-up
7 changes: 7 additions & 0 deletions docs/references/javascript/sign-up/sign-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ function create(params: SignUpCreateParams): Promise<SignUpResource>
- `boolean`

Transfer the user to a dedicated sign-up for an OAuth flow.

---

- `legalAccepted`
- `boolean`

The user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
</Properties>

### `update()`
Expand Down
7 changes: 7 additions & 0 deletions docs/references/javascript/user/user.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to

---

- `legalAcceptedAt`
- `Date`

Date when the user accepted the legal documents. May be empty if [**Require express consent to legal documents**](/docs/authentication/configuration/legal-compliance) is not enabled.

---

- `lastSignInAt`
- `Date`

Expand Down

0 comments on commit 95da7d2

Please sign in to comment.