Skip to content

Commit dd3813c

Browse files
NicolasLopes7LauraBeatris
authored andcommitted
feat(shared,ui): Add handling for user_deactivated error code (#7810)
Co-authored-by: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com>
1 parent 2e44353 commit dd3813c

4 files changed

Lines changed: 9 additions & 0 deletions

File tree

.changeset/nice-worlds-brake.md

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

packages/shared/src/internal/clerk-js/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const ERROR_CODES = {
4747
FRAUD_ACTION_BLOCKED: 'action_blocked',
4848
SIGNUP_RATE_LIMIT_EXCEEDED: 'signup_rate_limit_exceeded',
4949
USER_BANNED: 'user_banned',
50+
USER_DEACTIVATED: 'user_deactivated',
5051
} as const;
5152

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

packages/ui/src/components/SignIn/SignInStart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ function SignInStartInternal(): JSX.Element {
297297
case ERROR_CODES.FRAUD_ACTION_BLOCKED:
298298
case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:
299299
case ERROR_CODES.USER_BANNED:
300+
case ERROR_CODES.USER_DEACTIVATED:
300301
card.setError(error);
301302
break;
302303
default:

packages/ui/src/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)