refactor: use POST not PUT for `/users/{name}/change_pwd`
This commit is contained in:
parent
1ddfa92119
commit
7bdb029745
|
@ -147,7 +147,7 @@ schema("/users/:username") ->
|
|||
schema("/users/:username/change_pwd") ->
|
||||
#{
|
||||
'operationId' => change_pwd,
|
||||
put => #{
|
||||
post => #{
|
||||
tags => [<<"dashboard">>],
|
||||
desc => ?DESC(change_pwd_api),
|
||||
parameters => fields([username_in_path]),
|
||||
|
@ -324,7 +324,7 @@ is_self_auth_token(Username, Token) ->
|
|||
false
|
||||
end.
|
||||
|
||||
change_pwd(put, #{bindings := #{username := Username}, body := Params}) ->
|
||||
change_pwd(post, #{bindings := #{username := Username}, body := Params}) ->
|
||||
LogMeta = #{msg => "Dashboard change password", username => Username},
|
||||
OldPwd = maps:get(<<"old_pwd">>, Params),
|
||||
NewPwd = maps:get(<<"new_pwd">>, Params),
|
||||
|
|
|
@ -141,7 +141,7 @@ t_rest_api(_Config) ->
|
|||
}),
|
||||
{ok, 204, _} = http_delete(["users", "usera"]),
|
||||
{ok, 404, _} = http_delete(["users", "usera"]),
|
||||
{ok, 204, _} = http_put(
|
||||
{ok, 204, _} = http_post(
|
||||
["users", "admin", "change_pwd"],
|
||||
#{
|
||||
<<"old_pwd">> => <<"public">>,
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
|
||||
- Refactor: move `/mqtt/sys_topics` to generic `/configs/sys_topics` [#9511](https://github.com/emqx/emqx/pull/9511).
|
||||
|
||||
- Refactor: use `POST` not `PUT` for `/users/{name}/change_pwd` [#9533](https://github.com/emqx/emqx/pull/9533).
|
||||
|
||||
## Bug fixes
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
|
||||
- 重构:删除 `/mqtt/sys_topics` 接口,用户可以使用通用的 `/configs/sys_topics` 接口来更新该配置 [#9511](https://github.com/emqx/emqx/pull/9511)。
|
||||
|
||||
- 重构: `/users/{name}/change_pwd` 的请求方式从 `PUT` 改为了 `POST` [#9533](https://github.com/emqx/emqx/pull/9533)。
|
||||
|
||||
## 修复
|
||||
|
|
Loading…
Reference in New Issue