From b36d13d90ca7835f385cb744f2b6a94d05220d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:45:03 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E3=83=AD=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E7=94=BB=E9=9D=A2=E3=81=A7=E3=82=AD=E3=83=A3=E3=83=97?= =?UTF-8?q?=E3=83=81=E3=83=A3=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#14694)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): ログイン画面でキャプチャが表示されない問題を修正 * rename --- packages/frontend/src/components/MkSignin.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/MkSignin.vue b/packages/frontend/src/components/MkSignin.vue index 81a98cae0e..03dd61f6c6 100644 --- a/packages/frontend/src/components/MkSignin.vue +++ b/packages/frontend/src/components/MkSignin.vue @@ -124,7 +124,7 @@ function onPasskeyLogin(): void { page.value = 'passkey'; waiting.value = false; }) - .catch(onLoginFailed); + .catch(onSigninApiError); } } @@ -137,11 +137,11 @@ function onPasskeyDone(credential: AuthenticationPublicKeyCredential): void { context: passkeyContext.value, }).then((res) => { if (res.signinResponse == null) { - onLoginFailed(); + onSigninApiError(); return; } emit('login', res.signinResponse); - }).catch(onLoginFailed); + }).catch(onSigninApiError); } else if (userInfo.value != null) { tryLogin({ username: userInfo.value.username, @@ -231,7 +231,7 @@ async function tryLogin(req: Partial): Promise { - onLoginFailed(err); + onSigninApiError(err); return Promise.reject(err); }); } @@ -242,16 +242,18 @@ async function onLoginSucceeded(res: Misskey.entities.SigninResponse) { } } -function onLoginFailed(err?: any): void { +function onSigninApiError(err?: any): void { const id = err?.id ?? null; if (typeof err === 'object' && 'next' in err) { switch (err.next) { case 'captcha': { + needCaptcha.value = true; page.value = 'password'; break; } case 'password': { + needCaptcha.value = false; page.value = 'password'; break; } @@ -365,6 +367,7 @@ function onLoginFailed(err?: any): void { onBeforeUnmount(() => { password.value = ''; + needCaptcha.value = false; userInfo.value = null; });