@@ -8,18 +8,18 @@ const char* password = "........";
88ESP8266WebServer server (80 );
99
1010// Check if header is present and correct
11- bool is_authentified () {
12- Serial.println (" Enter is_authentified " );
11+ bool is_authenticated () {
12+ Serial.println (" Enter is_authenticated " );
1313 if (server.hasHeader (" Cookie" )) {
1414 Serial.print (" Found cookie: " );
1515 String cookie = server.header (" Cookie" );
1616 Serial.println (cookie);
1717 if (cookie.indexOf (" ESPSESSIONID=1" ) != -1 ) {
18- Serial.println (" Authentification Successful" );
18+ Serial.println (" Authentication Successful" );
1919 return true ;
2020 }
2121 }
22- Serial.println (" Authentification Failed" );
22+ Serial.println (" Authentication Failed" );
2323 return false ;
2424}
2525
@@ -59,11 +59,11 @@ void handleLogin() {
5959 server.send (200 , " text/html" , content);
6060}
6161
62- // root page can be accessed only if authentification is ok
62+ // root page can be accessed only if authentication is ok
6363void handleRoot () {
6464 Serial.println (" Enter handleRoot" );
6565 String header;
66- if (!is_authentified ()) {
66+ if (!is_authenticated ()) {
6767 server.sendHeader (" Location" , " /login" );
6868 server.sendHeader (" Cache-Control" , " no-cache" );
6969 server.send (301 );
@@ -77,7 +77,7 @@ void handleRoot() {
7777 server.send (200 , " text/html" , content);
7878}
7979
80- // no need authentification
80+ // no need authentication
8181void handleNotFound () {
8282 String message = " File Not Found\n\n " ;
8383 message += " URI: " ;
@@ -114,7 +114,7 @@ void setup(void) {
114114 server.on (" /" , handleRoot);
115115 server.on (" /login" , handleLogin);
116116 server.on (" /inline" , []() {
117- server.send (200 , " text/plain" , " this works without need of authentification " );
117+ server.send (200 , " text/plain" , " this works without need of authentication " );
118118 });
119119
120120 server.onNotFound (handleNotFound);
0 commit comments