Refactoring namespace for OpenWifi.

This commit is contained in:
stephb9959
2021-09-02 19:03:52 -07:00
parent 8873c70e8a
commit c0137c256c
3 changed files with 1 additions and 14 deletions

View File

@@ -13,27 +13,20 @@ namespace OpenWifi {
if (!ContinueProcessing(Request, Response))
return;
std::cout << "Line: " << __LINE__ << std::endl;
if (!IsAuthorized(Request, Response))
return;
std::cout << "Line: " << __LINE__ << std::endl;
try {
Poco::URI URI(Request.getURI());
auto Parameters = URI.getQueryParameters();
std::cout << "Line: " << __LINE__ << std::endl;
for(auto const &i:Parameters) {
std::cout << "Line: " << __LINE__ << std::endl;
if (i.first == "token") {
// can we find this token?
std::cout << "Line: " << __LINE__ << std::endl;
SecurityObjects::UserInfoAndPolicy SecObj;
std::cout << "Line: " << i.first << std::endl;
if (AuthService()->IsValidToken(i.second, SecObj.webtoken, SecObj.userinfo)) {
Poco::JSON::Object Obj;
SecObj.to_json(Obj);
ReturnObject(Request, Obj, Response);
std::cout << "Line: " << SecObj.webtoken.access_token_ << std::endl;
return;
}
}