diff --git a/apps/web/app/auth/confirm/route.ts b/apps/web/app/auth/confirm/route.ts index 534f71d15..9f22193cf 100644 --- a/apps/web/app/auth/confirm/route.ts +++ b/apps/web/app/auth/confirm/route.ts @@ -4,11 +4,15 @@ import { type EmailOtpType } from '@supabase/supabase-js'; import { getSupabaseRouteHandlerClient } from '@kit/supabase/route-handler-client'; +import pathsConfig from '~/config/paths.config'; + +const defaultNextUrl = pathsConfig.app.home; + export async function GET(request: NextRequest) { const { searchParams } = new URL(request.url); const token_hash = searchParams.get('token_hash'); const type = searchParams.get('type') as EmailOtpType | null; - const next = searchParams.get('next') ?? '/'; + const next = searchParams.get('next') ?? defaultNextUrl; const redirectTo = request.nextUrl.clone(); redirectTo.pathname = next; diff --git a/packages/features/auth/src/captcha/client/captcha-token-setter.tsx b/packages/features/auth/src/captcha/client/captcha-token-setter.tsx new file mode 100644 index 000000000..bfb8f51de --- /dev/null +++ b/packages/features/auth/src/captcha/client/captcha-token-setter.tsx @@ -0,0 +1,28 @@ +'use client'; + +import { useContext } from 'react'; + +import { Turnstile, TurnstileProps } from '@marsidev/react-turnstile'; + +import { Captcha } from './captcha-provider'; + +export function CaptchaTokenSetter(props: { + siteKey: string | undefined; + options?: TurnstileProps; +}) { + const { setToken } = useContext(Captcha); + + if (!props.siteKey) { + return null; + } + + const options = props.options ?? { + options: { + size: 'invisible', + }, + }; + + return ( + + ); +} diff --git a/packages/features/auth/src/captcha/client/captchaTokenSetter.tsx b/packages/features/auth/src/captcha/client/captchaTokenSetter.tsx deleted file mode 100644 index 59068be39..000000000 --- a/packages/features/auth/src/captcha/client/captchaTokenSetter.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client'; - -import { useContext } from 'react'; - -import { Turnstile } from '@marsidev/react-turnstile'; - -import { Captcha } from './captcha-provider'; - -export function CaptchaTokenSetter(props: { siteKey: string | undefined }) { - const { setToken } = useContext(Captcha); - - if (!props.siteKey) { - return null; - } - - return ; -} diff --git a/packages/features/auth/src/captcha/client/index.ts b/packages/features/auth/src/captcha/client/index.ts index 14f70c5f0..27762c227 100644 --- a/packages/features/auth/src/captcha/client/index.ts +++ b/packages/features/auth/src/captcha/client/index.ts @@ -1,3 +1,3 @@ -export * from './captchaTokenSetter'; +export * from './captcha-token-setter'; export * from './use-captcha-token'; export * from './captcha-provider';