Skip to content

Commit 081f144

Browse files
authored
fix(clerk-js): Add support for user_banned error in OAuth flows (#6639)
1 parent deaafe4 commit 081f144

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

.changeset/two-pots-beam.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+
Add support for the user_banned error on OAuth flows

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const ERROR_CODES = {
3939
FRAUD_DEVICE_BLOCKED: 'device_blocked',
4040
FRAUD_ACTION_BLOCKED: 'action_blocked',
4141
SIGNUP_RATE_LIMIT_EXCEEDED: 'signup_rate_limit_exceeded',
42+
USER_BANNED: 'user_banned',
4243
} as const;
4344

4445
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
@@ -289,6 +289,7 @@ function SignInStartInternal(): JSX.Element {
289289
case ERROR_CODES.FRAUD_DEVICE_BLOCKED:
290290
case ERROR_CODES.FRAUD_ACTION_BLOCKED:
291291
case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:
292+
case ERROR_CODES.USER_BANNED:
292293
card.setError(error);
293294
break;
294295
default:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ function SignUpStartInternal(): JSX.Element {
219219
case ERROR_CODES.FRAUD_DEVICE_BLOCKED:
220220
case ERROR_CODES.FRAUD_ACTION_BLOCKED:
221221
case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:
222+
case ERROR_CODES.USER_BANNED:
222223
card.setError(error);
223224
break;
224225
default:

0 commit comments

Comments
 (0)