mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-03-25 18:36:50 +01:00
Fix: force websocket clients to authenticate
when changing the security settings (disabling read-only access or changing the password), existing websocket connections are now closed, forcing the respective clients to authenticate (with the new password). otherwise, existing websocket clients keep connected even though the security settings now expect authentication with a (changed) password.
This commit is contained in:
@@ -36,8 +36,11 @@ void WebApiWsConsoleClass::reload()
|
||||
|
||||
if (config.Security.AllowReadonly) { return; }
|
||||
|
||||
_ws.enable(false);
|
||||
_simpleDigestAuth.setPassword(config.Security.Password);
|
||||
_ws.addMiddleware(&_simpleDigestAuth);
|
||||
_ws.closeAll();
|
||||
_ws.enable(true);
|
||||
}
|
||||
|
||||
void WebApiWsConsoleClass::wsCleanupTaskCb()
|
||||
|
||||
@@ -50,8 +50,11 @@ void WebApiWsLiveClass::reload()
|
||||
|
||||
if (config.Security.AllowReadonly) { return; }
|
||||
|
||||
_ws.enable(false);
|
||||
_simpleDigestAuth.setPassword(config.Security.Password);
|
||||
_ws.addMiddleware(&_simpleDigestAuth);
|
||||
_ws.closeAll();
|
||||
_ws.enable(true);
|
||||
}
|
||||
|
||||
void WebApiWsLiveClass::wsCleanupTaskCb()
|
||||
|
||||
Reference in New Issue
Block a user