mirror of
https://github.com/databasus/databasus.git
synced 2026-04-06 00:32:03 +02:00
Merge pull request #457 from databasus/develop
FIX (playground): Make turnstile mandatory in sign in and sign up
This commit is contained in:
@@ -4,7 +4,12 @@ import { type JSX, useState } from 'react';
|
||||
|
||||
import { useCloudflareTurnstile } from '../../../shared/hooks/useCloudflareTurnstile';
|
||||
|
||||
import { GITHUB_CLIENT_ID, GOOGLE_CLIENT_ID, IS_EMAIL_CONFIGURED } from '../../../constants';
|
||||
import {
|
||||
CLOUDFLARE_TURNSTILE_SITE_KEY,
|
||||
GITHUB_CLIENT_ID,
|
||||
GOOGLE_CLIENT_ID,
|
||||
IS_EMAIL_CONFIGURED,
|
||||
} from '../../../constants';
|
||||
import { userApi } from '../../../entity/users';
|
||||
import { StringUtils } from '../../../shared/lib';
|
||||
import { FormValidator } from '../../../shared/lib/FormValidator';
|
||||
@@ -129,7 +134,7 @@ export function SignInComponent({
|
||||
<CloudflareTurnstileWidget containerRef={containerRef} />
|
||||
|
||||
<Button
|
||||
disabled={isLoading}
|
||||
disabled={isLoading || (!!CLOUDFLARE_TURNSTILE_SITE_KEY && !token)}
|
||||
loading={isLoading}
|
||||
className="w-full"
|
||||
onClick={() => {
|
||||
|
||||
@@ -4,7 +4,12 @@ import { type JSX, useState } from 'react';
|
||||
|
||||
import { useCloudflareTurnstile } from '../../../shared/hooks/useCloudflareTurnstile';
|
||||
|
||||
import { GITHUB_CLIENT_ID, GOOGLE_CLIENT_ID, IS_CLOUD } from '../../../constants';
|
||||
import {
|
||||
CLOUDFLARE_TURNSTILE_SITE_KEY,
|
||||
GITHUB_CLIENT_ID,
|
||||
GOOGLE_CLIENT_ID,
|
||||
IS_CLOUD,
|
||||
} from '../../../constants';
|
||||
import { userApi } from '../../../entity/users';
|
||||
import { StringUtils } from '../../../shared/lib';
|
||||
import { FormValidator } from '../../../shared/lib/FormValidator';
|
||||
@@ -224,7 +229,11 @@ export function SignUpComponent({ onSwitchToSignIn }: SignUpComponentProps): JSX
|
||||
<CloudflareTurnstileWidget containerRef={containerRef} />
|
||||
|
||||
<Button
|
||||
disabled={isLoading || (IS_CLOUD && (!isTermsAccepted || !isPolicyAccepted))}
|
||||
disabled={
|
||||
isLoading ||
|
||||
(IS_CLOUD && (!isTermsAccepted || !isPolicyAccepted)) ||
|
||||
(!!CLOUDFLARE_TURNSTILE_SITE_KEY && !token)
|
||||
}
|
||||
loading={isLoading}
|
||||
className="w-full"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user