/auth/forgot-password
用户忘记密码时,通过邮箱或手机号发送密码重置验证码,支持邮箱和短信两种方式。参考:NIST SP 800-63B §5.1.1.2、OWASP ASVS V2.1。
请求体
Schema: service-identity/internal/handler/dto.ForgotPasswordRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
identity |
string |
是 | Email or phone | ||
tenant_id |
string |
否 | TenantID 显式租户(地址栏):body > query > X-Tenant-ID;空即 400(AUTH-04/09)。 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 验证码已发送至关联邮箱或手机 | service-identity/internal/handler/dto.ForgotPasswordResponse |
| 400 | 请求参数无效或用户不存在 | service-core/base/dto.SimpleResponse |
| 500 | 服务器内部错误 | service-core/base/dto.SimpleResponse |
引用的 Schema
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-identity/internal/handler/dto.ForgotPasswordResponse
忘记密码响应
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
expires_in |
integer |
否 | Expiration time | ||
message |
string |
否 | Message |