Send immediately 401 when disconnect

This commit is contained in:
Luc 2021-04-02 09:24:57 +02:00
parent 2876055a8c
commit c048c440ff
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H #define _VERSION_ESP3D_H
//version and sources location //version and sources location
#define FW_VERSION "3.0.0.a93" #define FW_VERSION "3.0.0.a94"
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H #endif //_VERSION_ESP3D_H

View File

@ -41,7 +41,7 @@ void HTTP_Server::handle_login()
AuthenticationService::ClearCurrentSession(); AuthenticationService::ClearCurrentSession();
_webserver->sendHeader("Set-Cookie","ESPSESSIONID=0"); _webserver->sendHeader("Set-Cookie","ESPSESSIONID=0");
_webserver->sendHeader("Cache-Control","no-cache"); _webserver->sendHeader("Cache-Control","no-cache");
_webserver->send(200, "application/json", "{\"status\":\"ok\",\"authentication_lvl\":\"guest\"}"); _webserver->send(401, "application/json", "{\"status\":\"disconnected\",\"authentication_lvl\":\"guest\"}");
return; return;
} }
level_authenticate_type auth_level = AuthenticationService::authenticated_level(); level_authenticate_type auth_level = AuthenticationService::authenticated_level();