diff --git a/src/MFAServer.cpp b/src/MFAServer.cpp index acb04d6..d9c5831 100644 --- a/src/MFAServer.cpp +++ b/src/MFAServer.cpp @@ -79,9 +79,10 @@ namespace OpenWifi { auto answer = ChallengeResponse->get("answer").toString(); std::string Expecting; - if(Hint->second.Method==MFAMETHODS::AUTHENTICATOR && - !TotpCache()->ValidateCode(Hint->second.UInfo.userinfo.userTypeProprietaryInfo.authenticatorSecret,answer, Expecting)) { - return false; + if(Hint->second.Method==MFAMETHODS::AUTHENTICATOR) { + if(!TotpCache()->ValidateCode(Hint->second.UInfo.userinfo.userTypeProprietaryInfo.authenticatorSecret,answer, Expecting)) { + return false; + } } else if(Hint->second.Answer!=answer) { return false; } diff --git a/src/RESTAPI/RESTAPI_user_handler.cpp b/src/RESTAPI/RESTAPI_user_handler.cpp index cf52166..ef7d955 100644 --- a/src/RESTAPI/RESTAPI_user_handler.cpp +++ b/src/RESTAPI/RESTAPI_user_handler.cpp @@ -234,7 +234,6 @@ namespace OpenWifi { std::string Secret; Existing.userTypeProprietaryInfo.mobiles.clear(); if(Existing.userTypeProprietaryInfo.authenticatorSecret.empty() && TotpCache()->CompleteValidation(UserInfo_.userinfo,false,Secret)) { - std::cout << "Secret:" << Secret << std::endl; Existing.userTypeProprietaryInfo.authenticatorSecret = Secret; } else if (!Existing.userTypeProprietaryInfo.authenticatorSecret.empty()) { // we allow someone to use their old secret diff --git a/src/TotpCache.h b/src/TotpCache.h index a833874..bd449d7 100644 --- a/src/TotpCache.h +++ b/src/TotpCache.h @@ -151,7 +151,6 @@ namespace OpenWifi { uint64_t Now = std::time(nullptr); if(Hint!=Cache_.end() && Subscriber==Hint->second.Subscriber && (Now-Hint->second.Start)<(15*60) && Hint->second.Done!=0) { Secret = Hint->second.Secret; - std::cout << "completed validation: " << Secret << std::endl; Cache_.erase(Hint); return true; }