diff --git a/CHANGELOG.md b/CHANGELOG.md index b941dd2166..c4956732c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## Unreleased ### General -- +- Enhance: セキュリティ向上のため、サインイン時もCAPTCHAを求めるようになりました ### Client - Enhance: ログイン画面の認証フローを改善 diff --git a/packages/frontend/src/components/MkSignin.vue b/packages/frontend/src/components/MkSignin.vue index 39dc63d3d9..0115f8f494 100644 --- a/packages/frontend/src/components/MkSignin.vue +++ b/packages/frontend/src/components/MkSignin.vue @@ -82,6 +82,14 @@ import XPasskey from '@/components/MkSignin.passkey.vue'; import type { AuthenticationPublicKeyCredential } from '@github/webauthn-json/browser-ponyfill'; 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<{ (ev: 'login', v: Misskey.entities.SigninResponse): void; }>(); diff --git a/packages/frontend/src/components/MkSignupDialog.form.vue b/packages/frontend/src/components/MkSignupDialog.form.vue index 4ab4380ad5..38cac7f644 100644 --- a/packages/frontend/src/components/MkSignupDialog.form.vue +++ b/packages/frontend/src/components/MkSignupDialog.form.vue @@ -81,10 +81,10 @@ SPDX-License-Identifier: AGPL-3.0-only import { ref, computed } from 'vue'; import { toUnicode } from 'punycode/'; import * as Misskey from 'misskey-js'; +import * as config from '@@/js/config.js'; import MkButton from './MkButton.vue'; import MkInput from './MkInput.vue'; import MkCaptcha, { type Captcha } from '@/components/MkCaptcha.vue'; -import * as config from '@@/js/config.js'; import * as os from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { login } from '@/account.js'; @@ -105,6 +105,7 @@ const emit = defineEmits<{ const host = toUnicode(config.host); const hcaptcha = ref(); +const mcaptcha = ref(); const recaptcha = ref(); const turnstile = ref(); @@ -281,6 +282,7 @@ async function onSubmit(): Promise { } catch { submitting.value = false; hcaptcha.value?.reset?.(); + mcaptcha.value?.reset?.(); recaptcha.value?.reset?.(); turnstile.value?.reset?.();