This commit is contained in:
kakkokari-gtyih 2024-10-05 02:07:47 +09:00
parent b6307b5ce2
commit cb426bc20b
1 changed files with 3 additions and 3 deletions

View File

@ -212,17 +212,17 @@ async function onTotpSubmitted(token: string) {
} }
} }
async function tryLogin(req: Partial<Misskey.entities.SigninRequest>): Promise<Misskey.entities.SigninFlowResponse> { async function tryLogin(req: Partial<Misskey.entities.SigninFlowRequest>): Promise<Misskey.entities.SigninFlowResponse> {
const _req = { const _req = {
username: req.username ?? userInfo.value?.username, username: req.username ?? userInfo.value?.username,
...req, ...req,
}; };
function assertIsSigninRequest(x: Partial<Misskey.entities.SigninRequest>): x is Misskey.entities.SigninRequest { function assertIsSigninFlowRequest(x: Partial<Misskey.entities.SigninFlowRequest>): x is Misskey.entities.SigninFlowRequest {
return x.username != null; return x.username != null;
} }
if (!assertIsSigninRequest(_req)) { if (!assertIsSigninFlowRequest(_req)) {
throw new Error('Invalid request'); throw new Error('Invalid request');
} }