password for add user moved to header

This commit is contained in:
EntireTwix 2021-06-10 12:17:50 -07:00
parent c40c63252c
commit 7dd215292f
2 changed files with 2 additions and 3 deletions

View file

@ -39,7 +39,7 @@
# User Management
| Name | Path | Method | A | Description |
| :----------: | :------------------------------------- | :----: | :---: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddUser | /user/{name} | POST | true | registers a user with the name `{name}`, balance of 0 and a password of the password supplied in the header |
| AddUser | /user/{name} | POST | true | registers a user with the name `{name}`, balance of 0 and a password of the password supplied in the body |
| AdminAddUser | /admin/user/{name}?init_bal={init_bal} | POST | true | if the password supplied in the header matches the admin password, then it registers a user with the name `{name}`, balance of `init_bal` and a password supplied by the body of the request |
| DelUser | /user/{name} | DELETE | true | if the password supplied in the header matches the user `{name}`'s password, then the user is deleted |
| AdminDelUser | /admin/user/{name} | DELETE | true | if the password supplied in the header matches the admin password, then the user is deleted |

View file

@ -55,8 +55,7 @@ void BankF::Close(req_args) const
}
void BankF::AddUser(req_args, std::string &&name) const
{
PASS_HEADER
JSON(bank.AddUser(std::move(name), std::move(pass)));
JSON(bank.AddUser(std::move(name), std::string(req->getBody())));
}
void BankF::AdminAddUser(req_args, std::string &&name, uint32_t init_bal) const
{