v3-password-resets-token.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-password-resets-token.yaml
  2. get:
  3. summary: 查看一次待完成的重置
  4. tags:
  5. - password-resets
  6. operationId: get_api_v3_password_resets_token_
  7. description: |-
  8. 重置页用它显示「正在为哪个账号设置新密码」。token 不存在或已过期一律 404。
  9. 实现:`V3\PasswordResetController@show`
  10. security:
  11. - { }
  12. -
  13. bearerAuth: []
  14. parameters:
  15. -
  16. name: token
  17. in: path
  18. required: true
  19. schema:
  20. type: string
  21. description: '邮件链接里的 token'
  22. responses:
  23. 200:
  24. description: 成功
  25. content:
  26. application/json:
  27. schema:
  28. type: object
  29. properties:
  30. data:
  31. type: object
  32. properties:
  33. username:
  34. type: string
  35. expires_at:
  36. type: string
  37. 404:
  38. description: 'token 无效或已过期'
  39. content:
  40. application/problem+json:
  41. schema:
  42. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  43. 422:
  44. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  45. patch:
  46. summary: 设置新密码
  47. tags:
  48. - password-resets
  49. operationId: patch_api_v3_password_resets_token_
  50. description: |-
  51. 成功后 token 作废,返回 204 空体;之后用新密码走登录。
  52. 实现:`V3\PasswordResetController@update`
  53. security:
  54. - { }
  55. -
  56. bearerAuth: []
  57. parameters:
  58. -
  59. name: token
  60. in: path
  61. required: true
  62. schema:
  63. type: string
  64. description: '邮件链接里的 token'
  65. requestBody:
  66. required: true
  67. content:
  68. application/json:
  69. schema:
  70. type: object
  71. properties:
  72. password:
  73. type: string
  74. description: '新密码,6–32 位'
  75. password_confirmation:
  76. type: string
  77. description: 再输一次新密码
  78. required:
  79. - password
  80. - password_confirmation
  81. responses:
  82. 204:
  83. description: 已重置,无响应体
  84. 404:
  85. description: 'token 无效或已过期'
  86. content:
  87. application/problem+json:
  88. schema:
  89. $ref: '../../main.yaml#/components/schemas/ProblemDetails'
  90. 422:
  91. $ref: '../../main.yaml#/components/responses/ProblemValidation'