From bf2b9e3692c1a20dd7af3d8bfca4b6c591cd2214 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 22 Dec 2016 18:52:34 -0800 Subject: [PATCH] Auto-authorize new members on public networks properly. --- controller/EmbeddedNetworkController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index ee2437775..bed76df77 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/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];