Changing SMS/MFA

This commit is contained in:
stephb9959
2022-05-06 08:31:17 -07:00
parent 44457d0f55
commit ce1764919f
2 changed files with 13 additions and 0 deletions

View File

@@ -150,6 +150,9 @@ namespace OpenWifi {
}
if(GetBoolParameter("resetMFA")) {
if(Request->getContentLength()>0) {
std::ignore = ParseStream();
}
if( (UserInfo_.userinfo.userRole == SecurityObjects::ROOT) ||
(UserInfo_.userinfo.userRole == SecurityObjects::ADMIN && Existing.userRole!=SecurityObjects::ROOT) ||
(UserInfo_.userinfo.id == Id)) {
@@ -174,6 +177,9 @@ namespace OpenWifi {
}
if(GetBoolParameter("forgotPassword")) {
if(Request->getContentLength()>0) {
std::ignore = ParseStream();
}
Existing.changePassword = true;
Logger_.information(fmt::format("FORGOTTEN-PASSWORD({}): Request for {}", Request->clientAddress().toString(), Existing.email));

View File

@@ -141,6 +141,7 @@ namespace OpenWifi {
}
void RESTAPI_user_handler::DoPut() {
std::string Id = GetBinding("id", "");
if(Id.empty()) {
return BadRequest(RESTAPI::Errors::MissingUserID);
@@ -156,6 +157,9 @@ namespace OpenWifi {
}
if(GetBoolParameter("resetMFA")) {
if(Request->getContentLength()>0) {
std::ignore = ParseStream();
}
if( (UserInfo_.userinfo.userRole == SecurityObjects::ROOT) ||
(UserInfo_.userinfo.userRole == SecurityObjects::ADMIN && Existing.userRole!=SecurityObjects::ROOT) ||
(UserInfo_.userinfo.id == Id)) {
@@ -180,6 +184,9 @@ namespace OpenWifi {
}
if(GetBoolParameter("forgotPassword")) {
if(Request->getContentLength()>0) {
std::ignore = ParseStream();
}
Existing.changePassword = true;
Logger_.information(fmt::format("FORGOTTEN-PASSWORD({}): Request for {}", Request->clientAddress().toString(), Existing.email));
SecurityObjects::ActionLink NewLink;