Refactoring namespace for OpenWifi.

This commit is contained in:
stephb9959
2021-09-02 18:11:10 -07:00
parent 72a2e7ab65
commit aa4b2fd0f0
2 changed files with 9 additions and 1 deletions

View File

@@ -13,21 +13,27 @@ 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.first, 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;
}
}