We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e5e24a commit 8a6baf9Copy full SHA for 8a6baf9
packages/clerk-js/src/core/fraudProtection.ts
@@ -1,4 +1,4 @@
1
-import { ClerkRuntimeError, isClerkAPIResponseError } from '@clerk/shared/error';
+import { ClerkRuntimeError, isClerkAPIResponseError, isClerkRuntimeError } from '@clerk/shared/error';
2
3
import { CaptchaChallenge } from '../utils/captcha/CaptchaChallenge';
4
import type { Clerk } from './resources/internal';
@@ -45,6 +45,12 @@ export class FraudProtection {
45
throw e;
46
}
47
48
+ // Network errors should bypass captcha logic and be re-thrown immediately
49
+ // so cache fallback can be triggered
50
+ if (isClerkRuntimeError(e) && e.code === 'network_error') {
51
+ throw e;
52
+ }
53
+
54
if (e.errors[0]?.code !== 'requires_captcha') {
55
56
0 commit comments