fix(#8133): hCaptcha の reCAPTCHA 互換挙動を無効化する (#8135)

* fix(#8133): hCaptcha の reCAPTCHA 互換挙動を無効化する

* Update packages/client/src/components/captcha.vue

* fix: hCaptcha host

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
Acid Chicken (硫酸鶏) 2022-01-21 17:43:14 +09:00 committed by GitHub
parent 2328ddf9a3
commit dd6b203d29

View File

@ -55,12 +55,10 @@ const variable = computed(() => {
const loaded = computed(() => !!window[variable.value]);
const src = computed(() => {
const endpoint = ({
hcaptcha: 'https://hcaptcha.com/1',
recaptcha: 'https://www.recaptcha.net/recaptcha',
} as Record<CaptchaProvider, string>)[props.provider];
return `${typeof endpoint === 'string' ? endpoint : 'about:invalid'}/api.js?render=explicit`;
switch (props.provider) {
case 'hcaptcha': return 'https://js.hcaptcha.com/1/api.js?render=explicit&recaptchacompat=off';
case 'recaptcha': return 'https://www.recaptcha.net/recaptcha/api.js?render=explicit';
}
});
const captcha = computed<Captcha>(() => window[variable.value] || {} as unknown as Captcha);