Fixing bug

This commit is contained in:
stephb9959
2022-06-14 07:22:17 -07:00
parent cb3f7a0872
commit a7e9c96f8d
2 changed files with 29 additions and 0 deletions

View File

@@ -11,25 +11,35 @@ namespace OpenWifi {
auto Reset = GetBoolParameter("reset",false);
std::string QRCode;
std::cout << __LINE__ << std::endl;
if(TotpCache()->StartValidation(UserInfo_.userinfo,false,QRCode,Reset)) {
std::cout << __LINE__ << std::endl;
return SendFileContent(QRCode, "image/svg+xml","qrcode.svg");
}
std::cout << __LINE__ << std::endl;
return BadRequest(RESTAPI::Errors::InvalidCommand);
}
void RESTAPI_totp_handler::DoPut() {
std::cout << __LINE__ << std::endl;
auto Value = GetParameter("value","");
std::cout << __LINE__ << std::endl;
auto nextIndex = GetParameter("index",0);
std::cout << __LINE__ << std::endl;
bool moreCodes=false;
std::cout << __LINE__ << std::endl;
RESTAPI::Errors::msg Err;
std::cout << __LINE__ << std::endl;
if(TotpCache()->ContinueValidation(UserInfo_.userinfo,false,Value,nextIndex,moreCodes, Err)) {
Poco::JSON::Object Answer;
Answer.set("nextIndex", nextIndex);
Answer.set("moreCodes", moreCodes);
std::cout << __LINE__ << std::endl;
return ReturnObject(Answer);
}
std::cout << __LINE__ << std::endl;
return BadRequest(Err);
}