fix(backend/SigninApiService): ログインのレートリミット時、意図したものと違うエラーメッセージが表示される可能性がある問題を修正 (MisskeyIO#903)
This commit is contained in:
parent
f60d9da614
commit
71c2921b9d
2 changed files with 9 additions and 4 deletions
|
@ -97,10 +97,15 @@ export class SigninApiService {
|
||||||
reply.code(429);
|
reply.code(429);
|
||||||
return {
|
return {
|
||||||
error: {
|
error: {
|
||||||
message: 'Too many failed attempts to sign in. Try again later.',
|
message: 'Rate limit exceeded. Please try again later.',
|
||||||
code: 'TOO_MANY_AUTHENTICATION_FAILURES',
|
code: 'RATE_LIMIT_EXCEEDED',
|
||||||
id: '22d05606-fbcf-421a-a2db-b32610dcfd1b',
|
id: '22d05606-fbcf-421a-a2db-b32610dcfd1b',
|
||||||
|
info: {
|
||||||
|
message: 'Too many failed attempts to sign in.',
|
||||||
|
code: 'TOO_MANY_AUTHENTICATION_FAILURES',
|
||||||
|
id: '6c181469-ecb9-42d2-82c9-60db5486a819',
|
||||||
},
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ export async function apiErrorHandler(err: Misskey.api.APIError, endpoint?: stri
|
||||||
} else if (err.code === 'ROLE_PERMISSION_DENIED') {
|
} else if (err.code === 'ROLE_PERMISSION_DENIED') {
|
||||||
title = i18n.ts.permissionDeniedError;
|
title = i18n.ts.permissionDeniedError;
|
||||||
text = i18n.ts.permissionDeniedErrorDescription;
|
text = i18n.ts.permissionDeniedErrorDescription;
|
||||||
} else if (err.code?.startsWith('TOO_MANY')) {
|
} else if (err.code?.startsWith('TOO_MANY_')) {
|
||||||
title = i18n.ts.youCannotCreateAnymore;
|
title = i18n.ts.youCannotCreateAnymore;
|
||||||
text = `${i18n.ts.error}: ${err.id}`;
|
text = `${i18n.ts.error}: ${err.id}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue