mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-03 04:07:45 +00:00
This commit is contained in:
@@ -37,23 +37,14 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RESTAPI_oauth2_handler::DoDelete() {
|
void RESTAPI_oauth2_handler::DoDelete() {
|
||||||
bool Expired = false, Contacted=false;
|
auto Token = GetBinding(RESTAPI::Protocol::TOKEN, "");
|
||||||
if (!IsAuthorized(Expired, Contacted)) {
|
if(Token.empty() || (Token != SessionToken_)) {
|
||||||
if(Expired)
|
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||||
return UnAuthorized(RESTAPI::Errors::EXPIRED_TOKEN);
|
|
||||||
return UnAuthorized(RESTAPI::Errors::INVALID_TOKEN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Token = GetBinding(RESTAPI::Protocol::TOKEN, "...");
|
|
||||||
if (Token == SessionToken_) {
|
|
||||||
AuthService()->Logout(Token);
|
AuthService()->Logout(Token);
|
||||||
return ReturnStatus(Poco::Net::HTTPResponse::HTTP_NO_CONTENT, true);
|
return ReturnStatus(Poco::Net::HTTPResponse::HTTP_NO_CONTENT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger_.information(fmt::format("BAD-LOGOUT({}): Request for {}", Request->clientAddress().toString(), UserInfo_.userinfo.email));
|
|
||||||
NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RESTAPI_oauth2_handler::DoPost() {
|
void RESTAPI_oauth2_handler::DoPost() {
|
||||||
|
|
||||||
const auto & Obj = ParsedBody_;
|
const auto & Obj = ParsedBody_;
|
||||||
|
|||||||
Reference in New Issue
Block a user