Typos and security verification.

This commit is contained in:
stephb9959
2021-07-10 16:08:51 -07:00
parent db57cbacae
commit 9566d191b2
12 changed files with 242 additions and 61 deletions

View File

@@ -30,6 +30,19 @@ namespace uCentral {
auto password = GetS(uCentral::RESTAPI::Protocol::PASSWORD, Obj);
auto newPassword = GetS(uCentral::RESTAPI::Protocol::NEWPASSWORD, Obj);
ParseParameters(Request);
if(GetParameter("forgotPassword","false") == "true") {
// Send an email to the userId
SecurityObjects::UserInfoAndPolicy UInfo;
AuthService()->SendEmailToUser(userId,AuthService::FORGOT_PASSWORD);
UInfo.webtoken.userMustChangePassword=true;
Poco::JSON::Object ReturnObj;
UInfo.webtoken.to_json(ReturnObj);
ReturnObject(Request, ReturnObj, Response);
return;
}
Poco::toLowerInPlace(userId);
SecurityObjects::UserInfoAndPolicy UInfo;