mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-10-30 02:12:32 +00:00
Changing SMS/MFA
This commit is contained in:
@@ -150,9 +150,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
if(GetBoolParameter("resetMFA")) {
|
||||
if(Request->getContentLength()>0) {
|
||||
std::ignore = ParseStream();
|
||||
}
|
||||
DrainBody();
|
||||
if( (UserInfo_.userinfo.userRole == SecurityObjects::ROOT) ||
|
||||
(UserInfo_.userinfo.userRole == SecurityObjects::ADMIN && Existing.userRole!=SecurityObjects::ROOT) ||
|
||||
(UserInfo_.userinfo.id == Id)) {
|
||||
@@ -177,9 +175,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
if(GetBoolParameter("forgotPassword")) {
|
||||
if(Request->getContentLength()>0) {
|
||||
std::ignore = ParseStream();
|
||||
}
|
||||
DrainBody();
|
||||
Existing.changePassword = true;
|
||||
Logger_.information(fmt::format("FORGOTTEN-PASSWORD({}): Request for {}", Request->clientAddress().toString(), Existing.email));
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ namespace OpenWifi {
|
||||
|
||||
SecurityObjects::UserInfo Existing;
|
||||
if(!StorageService()->UserDB().GetUserById(Id,Existing)) {
|
||||
DrainBody();
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
@@ -157,9 +158,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
if(GetBoolParameter("resetMFA")) {
|
||||
if(Request->getContentLength()>0) {
|
||||
std::ignore = ParseStream();
|
||||
}
|
||||
DrainBody();
|
||||
if( (UserInfo_.userinfo.userRole == SecurityObjects::ROOT) ||
|
||||
(UserInfo_.userinfo.userRole == SecurityObjects::ADMIN && Existing.userRole!=SecurityObjects::ROOT) ||
|
||||
(UserInfo_.userinfo.id == Id)) {
|
||||
@@ -184,9 +183,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
if(GetBoolParameter("forgotPassword")) {
|
||||
if(Request->getContentLength()>0) {
|
||||
std::ignore = ParseStream();
|
||||
}
|
||||
DrainBody();
|
||||
Existing.changePassword = true;
|
||||
Logger_.information(fmt::format("FORGOTTEN-PASSWORD({}): Request for {}", Request->clientAddress().toString(), Existing.email));
|
||||
SecurityObjects::ActionLink NewLink;
|
||||
|
||||
@@ -2011,7 +2011,13 @@ namespace OpenWifi {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void SetCommonHeaders(bool CloseConnection=false) {
|
||||
void DrainBody() {
|
||||
if (Request->getContentLength() > 0) {
|
||||
std::ignore = ParseStream();
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetCommonHeaders(bool CloseConnection=false) {
|
||||
Response->setVersion(Poco::Net::HTTPMessage::HTTP_1_1);
|
||||
Response->setChunkedTransferEncoding(true);
|
||||
Response->setContentType("application/json");
|
||||
|
||||
Reference in New Issue
Block a user