镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lockuser-protect-protections-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Update the `lockUser()` JSDoc to link to the **Protections** page under **Protect** (`/~/protect/protections`) in the Clerk Dashboard. Point the user lock links in the `lockUser()`, `unlockUser()`, `CreateUserParams.locked`, and `User.locked` JSDoc to the current guide on user locks.
6 changes: 3 additions & 3 deletions packages/backend/src/api/endpoints/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export type CreateUserParams = {
createdAt?: Date;
/** When set to `true`, the user is created already banned and cannot sign in. */
banned?: boolean;
/** When set to `true`, the user is created already locked. Requires the [user lockout feature](https://clerk.com/docs/guides/secure/user-lockout#lock-a-user-programmatically) to be enabled on the instance. */
/** When set to `true`, the user is created already locked. Requires the [user lockout feature](https://clerk.com/docs/guides/protect/user-lockout#lock-a-user-programmatically) to be enabled on the instance. */
locked?: boolean;
} & UserMetadataParams &
(UserPasswordHashingParams | object);
Expand Down Expand Up @@ -789,7 +789,7 @@ export class UserAPI extends AbstractAPI {
}

/**
* Locks the given [`User`](https://clerk.com/docs/reference/backend/types/backend-user), which means that they are not allowed to sign in again until the lock expires or is manually unlocked. By default, lockout duration is 1 hour, but it can be configured in the application's [**System**](https://dashboard.clerk.com/~/protect/rules) settings under **Protect** > **Rules**. See the [guide on user locks](https://clerk.com/docs/guides/secure/user-lockout).
* Locks the given [`User`](https://clerk.com/docs/reference/backend/types/backend-user), which means that they are not allowed to sign in again until the lock expires or is manually unlocked. By default, lockout duration is 1 hour, but it can be configured on the application's [**Protections**](https://dashboard.clerk.com/~/protect/protections) page under **Protect**. See the [guide on user locks](https://clerk.com/docs/guides/protect/user-lockout).
* @param userId - The ID of the user to lock.
*/
public async lockUser(userId: string) {
Expand All @@ -800,7 +800,7 @@ export class UserAPI extends AbstractAPI {
});
}

/** Removes a sign-in lock from the given [`User`](https://clerk.com/docs/reference/backend/types/backend-user), allowing them to sign in again. See the [guide on user locks](https://clerk.com/docs/guides/secure/user-lockout).
/** Removes a sign-in lock from the given [`User`](https://clerk.com/docs/reference/backend/types/backend-user), allowing them to sign in again. See the [guide on user locks](https://clerk.com/docs/guides/protect/user-lockout).
* @param userId - The ID of the user to unlock.
*/
public async unlockUser(userId: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/api/resources/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class User {
readonly twoFactorEnabled: boolean,
/** Whether the user is banned or not. */
readonly banned: boolean,
/** Whether the user is [locked](https://clerk.com/docs/guides/secure/user-lockout) or not. */
/** Whether the user is [locked](https://clerk.com/docs/guides/protect/user-lockout) or not. */
readonly locked: boolean,
/** The Unix timestamp when the user was first created. */
readonly createdAt: number,
Expand Down
Loading