mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 19:27:59 +00:00
Filtering credentials.
This commit is contained in:
@@ -17,6 +17,13 @@
|
|||||||
#include "StorageService.h"
|
#include "StorageService.h"
|
||||||
|
|
||||||
namespace OpenWifi {
|
namespace OpenWifi {
|
||||||
|
|
||||||
|
static void FilterCredentials(SecurityObjects::UserInfo & U) {
|
||||||
|
U.currentPassword.clear();
|
||||||
|
U.lastPasswords.clear();
|
||||||
|
U.oauthType.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void RESTAPI_oauth2Handler::DoGet() {
|
void RESTAPI_oauth2Handler::DoGet() {
|
||||||
bool Expired = false;
|
bool Expired = false;
|
||||||
if (!IsAuthorized(Expired)) {
|
if (!IsAuthorized(Expired)) {
|
||||||
@@ -28,7 +35,9 @@ namespace OpenWifi {
|
|||||||
if(GetMe) {
|
if(GetMe) {
|
||||||
Logger_.information(Poco::format("REQUEST-ME(%s): Request for %s", Request->clientAddress().toString(), UserInfo_.userinfo.email));
|
Logger_.information(Poco::format("REQUEST-ME(%s): Request for %s", Request->clientAddress().toString(), UserInfo_.userinfo.email));
|
||||||
Poco::JSON::Object Me;
|
Poco::JSON::Object Me;
|
||||||
UserInfo_.userinfo.to_json(Me);
|
SecurityObjects::UserInfo ReturnedUser = UserInfo_.userinfo;
|
||||||
|
FilterCredentials(ReturnedUser);
|
||||||
|
ReturnedUser.to_json(Me);
|
||||||
return ReturnObject(Me);
|
return ReturnObject(Me);
|
||||||
}
|
}
|
||||||
BadRequest(RESTAPI::Errors::UnrecognizedRequest);
|
BadRequest(RESTAPI::Errors::UnrecognizedRequest);
|
||||||
|
|||||||
Reference in New Issue
Block a user