Skip to content

Commit 7805d5e

Browse files
authoredMar 10, 2025··
chore(clerk-js,types): Remove hCaptcha implementation [Core 1] (#5317)
1 parent b873d6c commit 7805d5e

File tree

8 files changed

+60
-189
lines changed

8 files changed

+60
-189
lines changed
 

‎.changeset/curly-candles-love.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
'@clerk/types': patch
4+
---
5+
6+
Remove hCaptcha implementation

‎.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: npx turbo lint $TURBO_ARGS -- --quiet
7272

7373
- name: Upload Turbo Summary
74-
uses: actions/upload-artifact@v3
74+
uses: actions/upload-artifact@v4
7575
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
7676
continue-on-error: true
7777
with:
@@ -115,7 +115,7 @@ jobs:
115115
NODE_VERSION: ${{ matrix.node-version }}
116116

117117
- name: Upload Turbo Summary
118-
uses: actions/upload-artifact@v3
118+
uses: actions/upload-artifact@v4
119119
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
120120
continue-on-error: true
121121
with:

‎package-lock.json

+49-56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@commitlint/config-conventional": "^17.7.0",
5252
"@emotion/jest": "^11.11.0",
5353
"@faker-js/faker": "^8.1.0",
54-
"@hcaptcha/types": "^1.0.3",
5554
"@octokit/rest": "^20.0.2",
5655
"@playwright/test": "^1.39.0",
5756
"@testing-library/dom": "^8.19.0",

‎packages/clerk-js/src/utils/captcha/getCaptchaToken.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { CaptchaProvider, CaptchaWidgetType } from '@clerk/types';
22

3-
import { getHCaptchaToken } from './hcaptcha';
43
import { getTunstileToken } from './turnstile';
54

65
type CaptchaOptions = {
@@ -16,9 +15,5 @@ type CaptchaOptions = {
1615
*/
1716
export const getCaptchaToken = (captchaOptions: CaptchaOptions) => {
1817
const { captchaProvider, ...captchaProviderOptions } = captchaOptions;
19-
if (captchaProvider === 'hcaptcha') {
20-
return getHCaptchaToken(captchaProviderOptions);
21-
} else {
22-
return getTunstileToken(captchaProviderOptions);
23-
}
18+
return getTunstileToken(captchaProviderOptions);
2419
};

‎packages/clerk-js/src/utils/captcha/hcaptcha.ts

-122
This file was deleted.

‎packages/clerk-js/src/utils/captcha/retrieveCaptchaInfo.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const retrieveCaptchaInfo = (clerk: Clerk) => {
1313
canUseCaptcha: _environment ? _environment.userSettings.signUp.captcha_enabled && clerk.isStandardBrowser : null,
1414
captchaURL: fapiClient
1515
.buildUrl({
16-
path: captchaProvider == 'hcaptcha' ? 'hcaptcha/1/api.js' : 'cloudflare/turnstile/v0/api.js',
16+
path: 'cloudflare/turnstile/v0/api.js',
1717
pathPrefix: '',
1818
search: '?render=explicit',
1919
})

‎packages/types/src/displayConfig.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { OAuthStrategy } from './strategies';
44

55
export type PreferredSignInStrategy = 'password' | 'otp';
66
export type CaptchaWidgetType = 'smart' | 'invisible' | null;
7-
export type CaptchaProvider = 'hcaptcha' | 'turnstile';
7+
export type CaptchaProvider = 'turnstile';
88

99
export interface DisplayConfigJSON {
1010
object: 'display_config';

0 commit comments

Comments
 (0)
Please sign in to comment.