refactor(frontend): フロントエンドの型エラー解消 (#16779)
This commit is contained in:
parent
fd2fe34270
commit
39e01b1dfe
|
|
@ -120,6 +120,7 @@ function onPasskeyLogin(): void {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
passkeyContext.value = res.context ?? '';
|
passkeyContext.value = res.context ?? '';
|
||||||
credentialRequest.value = parseRequestOptionsFromJSON({
|
credentialRequest.value = parseRequestOptionsFromJSON({
|
||||||
|
// @ts-expect-error TODO: misskey-js由来の型(@simplewebauthn/types)とフロントエンド由来の型(@github/webauthn-json)が合わない
|
||||||
publicKey: res.option,
|
publicKey: res.option,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -134,7 +135,7 @@ function onPasskeyDone(credential: AuthenticationPublicKeyCredential): void {
|
||||||
waiting.value = true;
|
waiting.value = true;
|
||||||
|
|
||||||
if (doingPasskeyFromInputPage.value) {
|
if (doingPasskeyFromInputPage.value) {
|
||||||
misskeyApi('signin-with-passkey', {
|
misskeyApi<Misskey.entities.SigninWithPasskeyResponse>('signin-with-passkey', {
|
||||||
credential: credential.toJSON(),
|
credential: credential.toJSON(),
|
||||||
context: passkeyContext.value,
|
context: passkeyContext.value,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|
@ -149,6 +150,7 @@ function onPasskeyDone(credential: AuthenticationPublicKeyCredential): void {
|
||||||
tryLogin({
|
tryLogin({
|
||||||
username: userInfo.value.username,
|
username: userInfo.value.username,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
|
// @ts-expect-error TODO: misskey-js由来の型(@simplewebauthn/types)とフロントエンド由来の型(@github/webauthn-json)が合わない
|
||||||
credential: credential.toJSON(),
|
credential: credential.toJSON(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -253,6 +255,7 @@ async function tryLogin(req: Partial<Misskey.entities.SigninFlowRequest>): Promi
|
||||||
case 'passkey': {
|
case 'passkey': {
|
||||||
if (webAuthnSupported()) {
|
if (webAuthnSupported()) {
|
||||||
credentialRequest.value = parseRequestOptionsFromJSON({
|
credentialRequest.value = parseRequestOptionsFromJSON({
|
||||||
|
// @ts-expect-error TODO: misskey-js由来の型(@simplewebauthn/types)とフロントエンド由来の型(@github/webauthn-json)が合わない
|
||||||
publicKey: res.authRequest,
|
publicKey: res.authRequest,
|
||||||
});
|
});
|
||||||
page.value = 'passkey';
|
page.value = 'passkey';
|
||||||
|
|
|
||||||
|
|
@ -3512,6 +3512,7 @@ type SigninFlowRequest = {
|
||||||
'g-recaptcha-response'?: string | null;
|
'g-recaptcha-response'?: string | null;
|
||||||
'turnstile-response'?: string | null;
|
'turnstile-response'?: string | null;
|
||||||
'm-captcha-response'?: string | null;
|
'm-captcha-response'?: string | null;
|
||||||
|
'testcaptcha-response'?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// @public (undocumented)
|
// @public (undocumented)
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,7 @@ export type SigninFlowRequest = {
|
||||||
'g-recaptcha-response'?: string | null;
|
'g-recaptcha-response'?: string | null;
|
||||||
'turnstile-response'?: string | null;
|
'turnstile-response'?: string | null;
|
||||||
'm-captcha-response'?: string | null;
|
'm-captcha-response'?: string | null;
|
||||||
|
'testcaptcha-response'?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SigninFlowResponse = {
|
export type SigninFlowResponse = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue