Fixing token revocation/

This commit is contained in:
stephb9959
2021-11-13 17:17:49 -08:00
parent c835e4d0b9
commit bc11a19ee4
2 changed files with 1 additions and 6 deletions

View File

@@ -77,7 +77,7 @@ namespace OpenWifi {
std::cout << "Fetching token from disk and updating cache: " << CallToken << " >" <<__LINE__<< std::endl;
if(RevocationDate!=0)
return false;
Expired = (Client->webtoken.created_ + Client->webtoken.expires_in_) < time(nullptr);
Expired = (UInfo2.webtoken.created_ + UInfo2.webtoken.expires_in_) < time(nullptr);
std::cout << "Fetching token from disk and updating cache: " << CallToken << " >" <<__LINE__<< std::endl;
if(StorageService()->GetUserById(UInfo.userinfo.Id,UInfo.userinfo)) {
std::cout << "Fetching token from disk and updating cache: " << CallToken << " >" <<__LINE__<< std::endl;

View File

@@ -47,11 +47,8 @@ namespace OpenWifi {
Poco::Data::Session Sess = Pool_->get();
Poco::Data::Statement Select(Sess);
std::cout << __func__ << " : " << __LINE__ << std::endl;
RevocationDate = 0 ;
std::cout << __func__ << " : " << __LINE__ << std::endl;
std::string St2{"SELECT " + AllTokensFieldsForSelect + " From Tokens WHERE Token=?"};
std::cout << __func__ << " : " << __LINE__ << std::endl;
Select << ConvertParams(St2),
Poco::Data::Keywords::into(UInfo.webtoken.access_token_),
Poco::Data::Keywords::into(UInfo.webtoken.refresh_token_),
@@ -62,9 +59,7 @@ namespace OpenWifi {
Poco::Data::Keywords::into(UInfo.webtoken.idle_timeout_),
Poco::Data::Keywords::into(RevocationDate),
Poco::Data::Keywords::use(Token);
std::cout << __func__ << " : " << __LINE__ << std::endl;
Select.execute();
std::cout << __func__ << " : " << __LINE__ << " Rev:" << RevocationDate << std::endl;
return true;
} catch (const Poco::Exception &E) {
Logger_.log(E);