diff --git a/packages/hydrooj/locales/zh.yaml b/packages/hydrooj/locales/zh.yaml index 510455e713..1167f855a1 100644 --- a/packages/hydrooj/locales/zh.yaml +++ b/packages/hydrooj/locales/zh.yaml @@ -425,6 +425,7 @@ Instead of copying the test data directly, the test data of the copied problems Introduce must not exceed 500 characters and it will be shown in the list view.: 简介不能超过 500 个字符,将显示在列表页面中。 Introduce: 简介 Invalid password for user {0}.: 用户 {0} 的密码错误。 +Invalid username or password.: 用户名或密码错误。 Invalid: 无效 Invitation Code: 邀请码 IO: 输入输出 diff --git a/packages/hydrooj/src/error.ts b/packages/hydrooj/src/error.ts index 94d42010ec..2171a7c60c 100644 --- a/packages/hydrooj/src/error.ts +++ b/packages/hydrooj/src/error.ts @@ -12,7 +12,7 @@ export const SendMailError = Err('SendMailError', UserFacingError, 'Failed to se export const AlreadyVotedError = Err('AlreadyVotedError', ForbiddenError, "You've already voted."); export const BuiltinLoginError = Err('BuiltinLoginError', ForbiddenError, 'Builtin login is disabled.'); -export const LoginError = Err('LoginError', ForbiddenError, 'Invalid password for user {0}.'); +export const LoginError = Err('LoginError', ForbiddenError, 'Invalid username or password.'); export const AccessDeniedError = Err('AccessDeniedError', ForbiddenError, 'Access denied.'); export const UserAlreadyExistError = Err('UserAlreadyExistError', ForbiddenError, 'User {0} already exists.'); export const InvalidTokenError = Err('InvalidTokenError', ForbiddenError, 'The {0} Token is invalid.'); @@ -67,7 +67,7 @@ export const ProblemConfigError = Err('ProblemConfigError', BadRequestError, 'In export const ProblemIsReferencedError = Err('ProblemIsReferencedError', BadRequestError, 'Cannot {0} of a referenced problem.'); export const AuthOperationError = Err('AuthOperationError', BadRequestError, '{0} is already {1}.'); -export const UserNotFoundError = Err('UserNotFoundError', NotFoundError, 'User {0} not found.'); +export const UserNotFoundError = Err('LoginError', ForbiddenError, 'Invalid username or password.'); export const NoProblemError = Err('NoProblemError', NotFoundError, 'No problem.'); export const RecordNotFoundError = Err('RecordNotFoundError', NotFoundError, 'Record {0} not found.'); export const ProblemDataNotFoundError = Err('ProblemDataNotFoundError', NotFoundError, 'Data of problem {0} not found.');