From 7dd215292f8c64e61dd121e4a05a7524365a7688 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Thu, 10 Jun 2021 12:17:50 -0700 Subject: [PATCH] password for add user moved to header --- help.md | 2 +- src/bank_f.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/help.md b/help.md index 8d34a56..e561bd7 100644 --- a/help.md +++ b/help.md @@ -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 | \ No newline at end of file diff --git a/src/bank_f.cpp b/src/bank_f.cpp index 56e40d9..7012e38 100644 --- a/src/bank_f.cpp +++ b/src/bank_f.cpp @@ -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 {