mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
✨ admin change password
This commit is contained in:
parent
766047dc07
commit
de694c6ebd
2 changed files with 13 additions and 4 deletions
|
|
@ -20,17 +20,19 @@ public:
|
|||
void VerifyPassword(req_args) const;
|
||||
|
||||
void ChangePassword(req_args) const;
|
||||
void AdminChangePassword(req_args) const;
|
||||
void SetBal(req_args) const;
|
||||
|
||||
void Help(req_args) const;
|
||||
void Ping(req_args) const;
|
||||
void Close(req_args) const;
|
||||
void Contains(req_args, const std::string &name) const;
|
||||
void AdminVerifyPass(req_args);
|
||||
|
||||
void AddUser(req_args) const;
|
||||
void AdminAddUser(req_args) const;
|
||||
void DelUser(req_args) const;
|
||||
void AdminDelUser(req_args) const;
|
||||
void Contains(req_args, const std::string &name) const;
|
||||
void AdminVerifyPass(req_args);
|
||||
#endif
|
||||
|
||||
METHOD_LIST_BEGIN
|
||||
|
|
@ -44,6 +46,7 @@ public:
|
|||
|
||||
//Meta Usage
|
||||
METHOD_ADD(api::ChangePassword, "/v1/user/change_password", Patch, Options, "UserFilter"); //expects ["new_pass"](string)
|
||||
METHOD_ADD(api::AdminChangePassword, "/v1/user/change_password", Patch, Options, "AdminFilter"); //expects ["name"](string) and ["new_pass"](string)
|
||||
METHOD_ADD(api::SetBal, "/v1/admin/set_balance", Patch, Options, "AdminFilter"); //expects ["amount"](32 bits)
|
||||
|
||||
//System Usage
|
||||
|
|
|
|||
|
|
@ -81,6 +81,12 @@ void api::ChangePassword(req_args) const
|
|||
bank.ChangePassword(NAME_PARAM, std::move(body["new_pass"].asCString())); //may make asString()
|
||||
RESPOND_TRUE //as we know the user exists and is verified
|
||||
}
|
||||
void api::AdminChangePassword(req_args) const
|
||||
{
|
||||
GEN_BODY
|
||||
bank.ChangePassword(body["name"].asCString(), std::move(body["new_pass"].asCString())); //may make asString()
|
||||
RESPOND_TRUE
|
||||
}
|
||||
void api::SetBal(req_args) const
|
||||
{
|
||||
GEN_BODY
|
||||
|
|
|
|||
Loading…
Reference in a new issue