mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-02 19:57:49 +00:00
Fixing the last command bugs
This commit is contained in:
@@ -49,7 +49,7 @@ namespace uCentral::Auth {
|
||||
void Service::Stop() {
|
||||
}
|
||||
|
||||
bool Service::IsAuthorized(Poco::Net::HTTPServerRequest & Request)
|
||||
bool Service::IsAuthorized(Poco::Net::HTTPServerRequest & Request, std::string & SessionToken)
|
||||
{
|
||||
if(!Secure_)
|
||||
return true;
|
||||
@@ -63,12 +63,23 @@ namespace uCentral::Auth {
|
||||
|
||||
auto Token = Tokens_.find(RequestToken);
|
||||
|
||||
return Token != Tokens_.end();
|
||||
if( Token == Tokens_.end() )
|
||||
return false;
|
||||
|
||||
SessionToken = RequestToken;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Service::Logout(const std::string &token) {
|
||||
std::lock_guard<std::mutex> guard(mutex_);
|
||||
|
||||
Tokens_.erase(token);
|
||||
}
|
||||
|
||||
std::string Service::GenerateToken() {
|
||||
static char buf[]={"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRESTUVWXYZ"};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user