Merge remote-tracking branch 'msky/signin-captcha' into enh-tweak-signin-dialog

This commit is contained in:
kakkokari-gtyih 2024-09-30 23:03:17 +09:00
commit 8865cefece
3 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,7 @@
## Unreleased ## Unreleased
### General ### General
- - Enhance: セキュリティ向上のため、サインイン時もCAPTCHAを求めるようになりました
### Client ### Client
- Enhance: ログイン画面の認証フローを改善 - Enhance: ログイン画面の認証フローを改善

View File

@ -82,6 +82,14 @@ import XPasskey from '@/components/MkSignin.passkey.vue';
import type { AuthenticationPublicKeyCredential } from '@github/webauthn-json/browser-ponyfill'; import type { AuthenticationPublicKeyCredential } from '@github/webauthn-json/browser-ponyfill';
import type { OpenOnRemoteOptions } from '@/scripts/please-login.js'; import type { OpenOnRemoteOptions } from '@/scripts/please-login.js';
const captchaFailed = computed((): boolean => {
return (
instance.enableHcaptcha && !hCaptchaResponse.value ||
instance.enableMcaptcha && !mCaptchaResponse.value ||
instance.enableRecaptcha && !reCaptchaResponse.value ||
instance.enableTurnstile && !turnstileResponse.value);
});
const emit = defineEmits<{ const emit = defineEmits<{
(ev: 'login', v: Misskey.entities.SigninResponse): void; (ev: 'login', v: Misskey.entities.SigninResponse): void;
}>(); }>();

View File

@ -81,10 +81,10 @@ SPDX-License-Identifier: AGPL-3.0-only
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { toUnicode } from 'punycode/'; import { toUnicode } from 'punycode/';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import * as config from '@@/js/config.js';
import MkButton from './MkButton.vue'; import MkButton from './MkButton.vue';
import MkInput from './MkInput.vue'; import MkInput from './MkInput.vue';
import MkCaptcha, { type Captcha } from '@/components/MkCaptcha.vue'; import MkCaptcha, { type Captcha } from '@/components/MkCaptcha.vue';
import * as config from '@@/js/config.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js'; import { misskeyApi } from '@/scripts/misskey-api.js';
import { login } from '@/account.js'; import { login } from '@/account.js';
@ -105,6 +105,7 @@ const emit = defineEmits<{
const host = toUnicode(config.host); const host = toUnicode(config.host);
const hcaptcha = ref<Captcha | undefined>(); const hcaptcha = ref<Captcha | undefined>();
const mcaptcha = ref<Captcha | undefined>();
const recaptcha = ref<Captcha | undefined>(); const recaptcha = ref<Captcha | undefined>();
const turnstile = ref<Captcha | undefined>(); const turnstile = ref<Captcha | undefined>();
@ -281,6 +282,7 @@ async function onSubmit(): Promise<void> {
} catch { } catch {
submitting.value = false; submitting.value = false;
hcaptcha.value?.reset?.(); hcaptcha.value?.reset?.();
mcaptcha.value?.reset?.();
recaptcha.value?.reset?.(); recaptcha.value?.reset?.();
turnstile.value?.reset?.(); turnstile.value?.reset?.();