mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2026-01-27 10:23:15 +00:00
Fixing token revocation/
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user