Browse Source

Auto-authorize new members on public networks properly.

Adam Ierymenko 8 years ago
parent
commit
bf2b9e3692
1 changed files with 2 additions and 1 deletions
  1. 2 1
      controller/EmbeddedNetworkController.cpp

+ 2 - 1
controller/EmbeddedNetworkController.cpp

@@ -1287,7 +1287,8 @@ void EmbeddedNetworkController::_request(
 		authorizedBy = "memberIsAuthorized";
 	} else if (!_jB(network["private"],true)) {
 		authorizedBy = "networkIsPublic";
-		if (!member.count("authorized"))
+		json &ahist = member["authHistory"];
+		if ((!ahist.is_array())||(ahist.size() == 0))
 			autoAuthorized = true;
 	} else {
 		char presentedAuth[512];