Skip to content

Commit 65f313a

Browse files
authored
fix(clerk-js): Do not bubble up CaptchaHeartbeat errors (#5032)
1 parent 5214d06 commit 65f313a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/stale-badgers-scream.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+
Do not throw error on `captchaHeartbeat` if `displayConfig` is `null`.

packages/clerk-js/src/core/auth/CaptchaHeartbeat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ export class CaptchaHeartbeat {
3535
}
3636

3737
private isEnabled() {
38-
return !!this.clerk.__unstable__environment?.displayConfig.captchaHeartbeat;
38+
return !!this.clerk.__unstable__environment?.displayConfig?.captchaHeartbeat;
3939
}
4040

4141
private clientBypass() {
4242
return this.clerk.client?.captchaBypass;
4343
}
4444

4545
private intervalInMs() {
46-
return this.clerk.__unstable__environment?.displayConfig.captchaHeartbeatIntervalMs ?? 10 * 60 * 1000;
46+
return this.clerk.__unstable__environment?.displayConfig?.captchaHeartbeatIntervalMs ?? 10 * 60 * 1000;
4747
}
4848
}

0 commit comments

Comments
 (0)