Skip to content

api connect/token 使用本地化错误提示 #25751

Description

@wuchang

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

目前 api connect/token 认证出错时,返回的内容都是固定的英文内容如 "Invalid username or password!",
希望能输出本地化的内容

Describe the solution you'd like

TokenController.Password.cs 在这个文件源码,重复三次字符串 "Invalid username or password!"
而且是硬编码,没有办法通过资源文件改为本地化内容,
api 返回 如:

{
  "error": "account_locked",
  "error_description": "The user account has been locked out due to invalid login attempts. Please wait a while and try again.",
  "error_uri": "https://documentation.openiddict.com/errors/ID2024"
}
{
  "error": "invalid_grant",
  "error_description": "Invalid username or password!",
  "error_uri": "https://documentation.openiddict.com/errors/ID2024"
}

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions