Abandon AC_AUTHSCOPE_EXCEPTCP, replace with AC_AUTHSCOPE_WITHCP #171

enhance/v120
Hieromon Ikasamo 5 years ago
parent 8c5e5a49ea
commit 4424032c36
  1. 6
      src/AutoConnectPage.cpp
  2. 2
      src/AutoConnectTypes.h

@ -1573,8 +1573,8 @@ PageElement* AutoConnect::_setupPage(String& uri) {
* Allow the page set upped to authenticate. * Allow the page set upped to authenticate.
* The argument parameter indicates that authentication is allowed with * The argument parameter indicates that authentication is allowed with
* the condition of the AutoConnect.authScope setting. * the condition of the AutoConnect.authScope setting.
* It determines to except authentication in the captive portal state * It determines to admit authentication in the captive portal state
* when the EXCEPTCP is enabled. * when the AP_AUTHSCOPE_WITHCP is enabled.
* @param allow Indication of whether to authenticate with the page. * @param allow Indication of whether to authenticate with the page.
*/ */
void AutoConnect::_authentication(bool allow) { void AutoConnect::_authentication(bool allow) {
@ -1587,7 +1587,7 @@ void AutoConnect::_authentication(bool allow) {
if (WiFi.status() != WL_CONNECTED && (WiFi.getMode() & WIFI_AP)) { if (WiFi.status() != WL_CONNECTED && (WiFi.getMode() & WIFI_AP)) {
String accUrl = _webServer->hostHeader(); String accUrl = _webServer->hostHeader();
if ((accUrl != WiFi.softAPIP().toString()) && !accUrl.endsWith(F(".local"))) { if ((accUrl != WiFi.softAPIP().toString()) && !accUrl.endsWith(F(".local"))) {
if (_apConfig.authScope & AC_AUTHSCOPE_EXCEPTCP) if (_apConfig.authScope & !AC_AUTHSCOPE_WITHCP)
allow = false; allow = false;
} }
} }

@ -52,7 +52,7 @@ typedef enum AC_AUTHSCOPE {
AC_AUTHSCOPE_AUX = 0x0002, // All AUX-pages are affected by an authentication. AC_AUTHSCOPE_AUX = 0x0002, // All AUX-pages are affected by an authentication.
AC_AUTHSCOPE_AC = 0x0004, // Allow authentication to AutoConnect pages. AC_AUTHSCOPE_AC = 0x0004, // Allow authentication to AutoConnect pages.
AC_AUTHSCOPE_PORTAL = AC_AUTHSCOPE_AC | AC_AUTHSCOPE_AUX, // All AutoConnect pages are affected by an authentication. AC_AUTHSCOPE_PORTAL = AC_AUTHSCOPE_AC | AC_AUTHSCOPE_AUX, // All AutoConnect pages are affected by an authentication.
AC_AUTHSCOPE_EXCEPTCP = 0x8000 // Ignore authentication even if AP only. AC_AUTHSCOPE_WITHCP = 0x8000 // Allows authenticating in the standalone state.
} AC_AUTHSCOPE_t; } AC_AUTHSCOPE_t;
/**< A type to enable authentication. */ /**< A type to enable authentication. */

Loading…
Cancel
Save