Optimize Turnstile load
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
PERMISSION_TWO_FACTOR_VERIFICATION_CODE_ERROR,
|
||||
PERMISSION_USER_DISABLE,
|
||||
PERMISSION_USERNAME_NOT_FOUND,
|
||||
SIZE_ICON_MD,
|
||||
SYSTEM_INVALID_CAPTCHA_CODE
|
||||
} from '@/constants/common.constants'
|
||||
import { getUserInfo, setToken } from '@/util/auth'
|
||||
@@ -226,11 +227,21 @@ const SignIn = () => {
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item>
|
||||
{!turnstileRef.current && (
|
||||
<div className={'loading-turnstile'}>
|
||||
<Icon
|
||||
component={IconOxygenLoading}
|
||||
style={{ fontSize: SIZE_ICON_MD }}
|
||||
spin
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<Turnstile
|
||||
id={'sign-in-turnstile'}
|
||||
ref={turnstileRefCallback}
|
||||
siteKey={H_CAPTCHA_SITE_KEY}
|
||||
options={{ theme: 'light', execution: 'execute' }}
|
||||
hidden={!turnstileRef.current}
|
||||
options={{ theme: 'light' }}
|
||||
onSuccess={setCaptchaCode}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
|
||||
Reference in New Issue
Block a user