Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
Stephane Bourque
2022-06-14 07:26:44 -07:00
committed by stephb9959
parent a7e9c96f8d
commit 5e12f00558
2 changed files with 1 additions and 32 deletions

View File

@@ -11,35 +11,24 @@ 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);
}