mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 11:47:56 +00:00
Fixing ActionLinks
This commit is contained in:
@@ -63,32 +63,32 @@ namespace OpenWifi {
|
||||
return ReturnObject(Answer);
|
||||
}
|
||||
|
||||
SecurityObjects::UserInfo UInfo1;
|
||||
if(!StorageService()->GetUserByEmail(userId,UInfo1)) {
|
||||
Logger_.warning(Poco::format("FORGOT-PASSWORD(%s): invalid e-mail from '%s'", userId, Request->clientAddress().toString()));
|
||||
Poco::JSON::Object ReturnObj;
|
||||
SecurityObjects::UserInfoAndPolicy UInfo;
|
||||
UInfo.webtoken.userMustChangePassword = true;
|
||||
UInfo.webtoken.to_json(ReturnObj);
|
||||
return ReturnObject(ReturnObj);
|
||||
}
|
||||
|
||||
if(GetBoolParameter(RESTAPI::Protocol::FORGOTPASSWORD,false)) {
|
||||
Logger_.information(Poco::format("FORGOTTEN-PASSWORD(%s): Request for %s", Request->clientAddress().toString(), userId));
|
||||
SecurityObjects::ActionLink NewLink;
|
||||
SecurityObjects::UserInfo UInfo1;
|
||||
auto UserExists = StorageService()->GetUserByEmail(userId,UInfo1);
|
||||
if(UserExists) {
|
||||
Logger_.information(Poco::format("FORGOTTEN-PASSWORD(%s): Request for %s", Request->clientAddress().toString(), userId));
|
||||
SecurityObjects::ActionLink NewLink;
|
||||
|
||||
NewLink.action = OpenWifi::SecurityObjects::LinkActions::FORGOT_PASSWORD;
|
||||
NewLink.id = MicroService::instance().CreateUUID();
|
||||
NewLink.userId = UInfo1.Id;
|
||||
NewLink.created = std::time(nullptr);
|
||||
NewLink.expires = NewLink.created + (24*60*60);
|
||||
StorageService()->CreateAction(NewLink);
|
||||
NewLink.action = OpenWifi::SecurityObjects::LinkActions::FORGOT_PASSWORD;
|
||||
NewLink.id = MicroService::instance().CreateUUID();
|
||||
NewLink.userId = UInfo1.Id;
|
||||
NewLink.created = std::time(nullptr);
|
||||
NewLink.expires = NewLink.created + (24*60*60);
|
||||
StorageService()->CreateAction(NewLink);
|
||||
|
||||
Poco::JSON::Object ReturnObj;
|
||||
SecurityObjects::UserInfoAndPolicy UInfo;
|
||||
UInfo.webtoken.userMustChangePassword = true;
|
||||
UInfo.webtoken.to_json(ReturnObj);
|
||||
return ReturnObject(ReturnObj);
|
||||
Poco::JSON::Object ReturnObj;
|
||||
SecurityObjects::UserInfoAndPolicy UInfo;
|
||||
UInfo.webtoken.userMustChangePassword = true;
|
||||
UInfo.webtoken.to_json(ReturnObj);
|
||||
return ReturnObject(ReturnObj);
|
||||
} else {
|
||||
Poco::JSON::Object ReturnObj;
|
||||
SecurityObjects::UserInfoAndPolicy UInfo;
|
||||
UInfo.webtoken.userMustChangePassword = true;
|
||||
UInfo.webtoken.to_json(ReturnObj);
|
||||
return ReturnObject(ReturnObj);
|
||||
}
|
||||
}
|
||||
|
||||
if(GetBoolParameter(RESTAPI::Protocol::RESENDMFACODE,false)) {
|
||||
|
||||
Reference in New Issue
Block a user