mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
trimming incoming values.
This commit is contained in:
@@ -11,11 +11,19 @@ namespace OpenWifi {
|
||||
void RESTAPI_signup_handler::DoPost() {
|
||||
auto UserName = GetParameter("email");
|
||||
Poco::toLowerInPlace(UserName);
|
||||
Poco::trimInPlace(UserName);
|
||||
|
||||
auto macAddress = GetParameter("macAddress");
|
||||
Poco::toLowerInPlace(macAddress);
|
||||
Poco::trimInPlace(macAddress);
|
||||
|
||||
auto deviceID = GetParameter("deviceID");
|
||||
Poco::toLowerInPlace(deviceID);
|
||||
Poco::trimInPlace(deviceID);
|
||||
|
||||
auto registrationId = GetParameter("registrationId");
|
||||
Poco::toLowerInPlace(registrationId);
|
||||
Poco::trimInPlace(registrationId);
|
||||
|
||||
if(UserName.empty() || macAddress.empty() || registrationId.empty()) {
|
||||
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||
@@ -59,10 +67,6 @@ namespace OpenWifi {
|
||||
}
|
||||
}
|
||||
|
||||
if(!StorageService()->OperatorDB().Exists("registrationId",registrationId)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRegistrationOperatorName);
|
||||
}
|
||||
|
||||
// So we do not have an outstanding signup...
|
||||
// Can we actually claim this serial number??? if not, we need to return an error
|
||||
ProvObjects::InventoryTag IT;
|
||||
|
||||
Reference in New Issue
Block a user