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