Skip to content

Commit dbdf83e

Browse files
authored
chore(clerk-js): Add handling for user_deactivated error code (#7811)
1 parent bca677e commit dbdf83e

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

.changeset/little-words-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Display message for `user_deactivated` error code on `SignIn` and `SignUp`

packages/clerk-js/src/core/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const ERROR_CODES = {
4141
FRAUD_ACTION_BLOCKED: 'action_blocked',
4242
SIGNUP_RATE_LIMIT_EXCEEDED: 'signup_rate_limit_exceeded',
4343
USER_BANNED: 'user_banned',
44+
USER_DEACTIVATED: 'user_deactivated',
4445
} as const;
4546

4647
export const SIGN_IN_INITIAL_VALUE_KEYS = ['email_address', 'phone_number', 'username'];

packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ function SignInStartInternal(): JSX.Element {
295295
case ERROR_CODES.FRAUD_ACTION_BLOCKED:
296296
case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:
297297
case ERROR_CODES.USER_BANNED:
298+
case ERROR_CODES.USER_DEACTIVATED:
298299
card.setError(error);
299300
break;
300301
default:

packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ function SignUpStartInternal(): JSX.Element {
224224
case ERROR_CODES.FRAUD_ACTION_BLOCKED:
225225
case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:
226226
case ERROR_CODES.USER_BANNED:
227+
case ERROR_CODES.USER_DEACTIVATED:
227228
card.setError(error);
228229
break;
229230
default:

0 commit comments

Comments
 (0)