Captchaがリセットされない問題を修正
This commit is contained in:
parent
ae4c690cb7
commit
65aac75a33
|
@ -49,7 +49,7 @@ export type PwResponse = {
|
|||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, defineAsyncComponent } from 'vue';
|
||||
import { ref, computed, useTemplateRef, defineAsyncComponent } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
|
||||
import { instance } from '@/instance.js';
|
||||
|
@ -70,6 +70,11 @@ const emit = defineEmits<{
|
|||
|
||||
const password = ref('');
|
||||
|
||||
const hCaptcha = useTemplateRef('hcaptcha');
|
||||
const mCaptcha = useTemplateRef('mcaptcha');
|
||||
const reCaptcha = useTemplateRef('recaptcha');
|
||||
const turnstile = useTemplateRef('turnstile');
|
||||
|
||||
const hCaptchaResponse = ref<string | null>(null);
|
||||
const mCaptchaResponse = ref<string | null>(null);
|
||||
const reCaptchaResponse = ref<string | null>(null);
|
||||
|
@ -100,6 +105,17 @@ function onSubmit() {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
function resetCaptcha() {
|
||||
hCaptcha.value?.reset();
|
||||
mCaptcha.value?.reset();
|
||||
reCaptcha.value?.reset();
|
||||
turnstile.value?.reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
resetCaptcha,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
|
@ -29,6 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<XPassword
|
||||
v-else-if="page === 'password'"
|
||||
key="password"
|
||||
ref="passwordPageEl"
|
||||
|
||||
:user="userInfo!"
|
||||
|
||||
|
@ -63,7 +64,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, shallowRef } from 'vue';
|
||||
import { ref, shallowRef, useTemplateRef } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { supported as webAuthnSupported, parseRequestOptionsFromJSON } from '@github/webauthn-json/browser-ponyfill';
|
||||
|
||||
|
@ -97,6 +98,7 @@ const props = withDefaults(defineProps<{
|
|||
});
|
||||
|
||||
const page = ref<'input' | 'password' | 'totp' | 'passkey'>('input');
|
||||
const passwordPageEl = useTemplateRef('passwordPageEl');
|
||||
const waiting = ref(false);
|
||||
|
||||
const userInfo = ref<null | Misskey.entities.UserDetailed>(null);
|
||||
|
@ -342,7 +344,11 @@ function onLoginFailed(err?: any): void {
|
|||
}
|
||||
}
|
||||
|
||||
doingPasskeyFromInputPage.value = false;
|
||||
if (doingPasskeyFromInputPage.value === true) {
|
||||
doingPasskeyFromInputPage.value = false;
|
||||
page.value = 'input';
|
||||
}
|
||||
passwordPageEl.value?.resetCaptcha();
|
||||
waiting.value = false;
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue