summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-10-04 18:45:03 +0900
committerGitHub <noreply@github.com>2024-10-04 18:45:03 +0900
commitb36d13d90ca7835f385cb744f2b6a94d05220d09 (patch)
treed436f564d4e6a42e9c3e92537da755923da789d1
parentBump version to 2024.10.0-beta.4 (diff)
downloadsharkey-b36d13d90ca7835f385cb744f2b6a94d05220d09.tar.gz
sharkey-b36d13d90ca7835f385cb744f2b6a94d05220d09.tar.bz2
sharkey-b36d13d90ca7835f385cb744f2b6a94d05220d09.zip
fix(frontend): ログイン画面でキャプチャが表示されない問題を修正 (#14694)
* fix(frontend): ログイン画面でキャプチャが表示されない問題を修正 * rename
-rw-r--r--packages/frontend/src/components/MkSignin.vue13
1 files 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<Misskey.entities.SigninRequest>): Promise<M
await onLoginSucceeded(res);
return res;
}).catch((err) => {
- 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;
});
</script>