Framework update.

This commit is contained in:
stephb9959
2022-05-03 08:36:40 -07:00
parent adde8a2f85
commit f300e64b06
2 changed files with 0 additions and 10 deletions

View File

@@ -63,8 +63,6 @@ namespace OpenWifi {
auto refreshToken = GetS("refresh_token", Obj);
auto grant_type = GetParameter("grant_type");
std::cout << __LINE__ << std::endl;
Poco::toLowerInPlace(userId);
if(!refreshToken.empty() && grant_type == "refresh_token") {
@@ -78,7 +76,6 @@ namespace OpenWifi {
}
}
std::cout << __LINE__ << std::endl;
if(GetBoolParameter(RESTAPI::Protocol::REQUIREMENTS, false)) {
Logger_.information(fmt::format("POLICY-REQUEST({}): Request.", Request->clientAddress().toString()));
Poco::JSON::Object Answer;
@@ -87,7 +84,6 @@ namespace OpenWifi {
Answer.set(RESTAPI::Protocol::PASSWORDPOLICY, AuthService()->GetPasswordPolicy());
return ReturnObject(Answer);
}
std::cout << __LINE__ << std::endl;
if(GetBoolParameter(RESTAPI::Protocol::FORGOTPASSWORD,false)) {
SecurityObjects::UserInfo UInfo1;
@@ -117,7 +113,6 @@ namespace OpenWifi {
return ReturnObject(ReturnObj);
}
}
std::cout << __LINE__ << std::endl;
if(GetBoolParameter(RESTAPI::Protocol::RESENDMFACODE,false)) {
Logger_.information(fmt::format("RESEND-MFA-CODE({}): Request for {}", Request->clientAddress().toString(), userId));
@@ -128,7 +123,6 @@ namespace OpenWifi {
}
return UnAuthorized(RESTAPI::Errors::InvalidCredentials, BAD_MFA_TRANSACTION);
}
std::cout << __LINE__ << std::endl;
if(GetBoolParameter(RESTAPI::Protocol::COMPLETEMFACHALLENGE,false)) {
Logger_.information(fmt::format("COMPLETE-MFA-CHALLENGE({}): Request for {}", Request->clientAddress().toString(), userId));
@@ -142,13 +136,11 @@ namespace OpenWifi {
}
return UnAuthorized(RESTAPI::Errors::InvalidCredentials, MFA_FAILURE);
}
std::cout << __LINE__ << std::endl;
SecurityObjects::UserInfoAndPolicy UInfo;
bool Expired=false;
auto Code=AuthService()->Authorize(userId, password, newPassword, UInfo, Expired);
if (Code==SUCCESS) {
std::cout << __LINE__ << std::endl;
Poco::JSON::Object ReturnObj;
if(AuthService()->RequiresMFA(UInfo)) {
if(MFAServer()->StartMFAChallenge(UInfo, ReturnObj)) {

View File

@@ -2040,13 +2040,11 @@ namespace OpenWifi {
inline void ProcessOptions() {
// try to figure out if we are doing a CORS options or plain OPTIONS
std::cout << __LINE__ << " : process_options" << std::endl;
AddCORS();
Response->set("Vary", "Origin, Access-Control-Request-Headers, Access-Control-Request-Method");
SetCommonHeaders();
Response->set("Access-Control-Allow-Credentials", "true");
Response->setContentLength(0);
// Response->setStatus(Poco::Net::HTTPResponse::HTTP_NO_CONTENT);
Response->setStatus(Poco::Net::HTTPResponse::HTTP_OK);
Response->send();
}