Change Password

已登录用户改密:先验旧密码,再写入新密码。

Logged-in user: verify current password, then set new password.

参数 session 由 require_login 注入,未登录会直接 401(sub_code=40101)。 返回:成功 success;新密码过短 40005;用户不存在 40402;旧密码错 40111。 副作用:写库(更新 password_hash)—— 用户身份取 session 而非请求体,避免越权改他人密码。

post/auth/changePassword

Request

  • Base URL: https://api.twtapi.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.twtapi.com/auth/changePassword
  • Auth: none declared

Query parameters

langstring

Request body

current_passwordstring required
new_passwordstring required

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.