From b188b3feb3953e10877dfc522b8fef5deb75d33e Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sat, 16 Nov 2024 16:57:32 -0800 Subject: [PATCH] Switch to HCaptcha for Auth-related captchas (#2945) * Switch to HCaptcha for Auth-related captchas * run fmt --- apps/frontend/nuxt.config.ts | 4 +- apps/frontend/package.json | 1 - apps/frontend/src/components/ui/HCaptcha.vue | 53 +++++++++ apps/frontend/src/pages/auth.vue | 14 --- .../src/pages/auth/reset-password.vue | 14 +-- apps/frontend/src/pages/auth/sign-in.vue | 14 +-- apps/frontend/src/pages/auth/sign-up.vue | 14 +-- apps/labrinth/.env | 2 +- apps/labrinth/src/lib.rs | 2 +- apps/labrinth/src/routes/internal/flows.rs | 40 +------ apps/labrinth/src/util/captcha.rs | 21 ++-- pnpm-lock.yaml | 101 +++++------------- 12 files changed, 117 insertions(+), 163 deletions(-) create mode 100644 apps/frontend/src/components/ui/HCaptcha.vue diff --git a/apps/frontend/nuxt.config.ts b/apps/frontend/nuxt.config.ts index 966fe4fb1..6f9418832 100644 --- a/apps/frontend/nuxt.config.ts +++ b/apps/frontend/nuxt.config.ts @@ -343,8 +343,6 @@ export default defineNuxtConfig({ globalThis.CF_PAGES_COMMIT_SHA || "unknown", - turnstile: { siteKey: "0x4AAAAAAAW3guHM6Eunbgwu" }, - stripePublishableKey: process.env.STRIPE_PUBLISHABLE_KEY || globalThis.STRIPE_PUBLISHABLE_KEY || @@ -362,7 +360,7 @@ export default defineNuxtConfig({ }, }, }, - modules: ["@vintl/nuxt", "@nuxtjs/turnstile", "@pinia/nuxt"], + modules: ["@vintl/nuxt", "@pinia/nuxt"], vintl: { defaultLocale: "en-US", locales: [ diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 3a13549f4..8311f3689 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -15,7 +15,6 @@ "devDependencies": { "@formatjs/cli": "^6.2.12", "@nuxt/devtools": "^1.3.3", - "@nuxtjs/turnstile": "^0.8.0", "@types/dompurify": "^3.0.5", "@types/node": "^20.1.0", "@vintl/compact-number": "^2.0.5", diff --git a/apps/frontend/src/components/ui/HCaptcha.vue b/apps/frontend/src/components/ui/HCaptcha.vue new file mode 100644 index 000000000..05262a816 --- /dev/null +++ b/apps/frontend/src/components/ui/HCaptcha.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/apps/frontend/src/pages/auth.vue b/apps/frontend/src/pages/auth.vue index b55f54f91..51392b242 100644 --- a/apps/frontend/src/pages/auth.vue +++ b/apps/frontend/src/pages/auth.vue @@ -60,20 +60,6 @@ } } -.turnstile { - display: flex; - justify-content: center; - overflow: hidden; - border-radius: var(--radius-md); - border: 2px solid var(--color-button-bg); - height: 66px; - - iframe { - margin: -1px; - min-width: calc(100% + 2px); - } -} - .auth-form { display: flex; flex-direction: column; diff --git a/apps/frontend/src/pages/auth/reset-password.vue b/apps/frontend/src/pages/auth/reset-password.vue index 074acb0fc..ad002a07d 100644 --- a/apps/frontend/src/pages/auth/reset-password.vue +++ b/apps/frontend/src/pages/auth/reset-password.vue @@ -22,12 +22,7 @@ /> - +