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:
parent
ebb225f6c0
commit
d5d1a9982f
@ -36,8 +36,11 @@ void WebApiWsConsoleClass::reload()
|
|||||||
|
|
||||||
if (config.Security.AllowReadonly) { return; }
|
if (config.Security.AllowReadonly) { return; }
|
||||||
|
|
||||||
|
_ws.enable(false);
|
||||||
_simpleDigestAuth.setPassword(config.Security.Password);
|
_simpleDigestAuth.setPassword(config.Security.Password);
|
||||||
_ws.addMiddleware(&_simpleDigestAuth);
|
_ws.addMiddleware(&_simpleDigestAuth);
|
||||||
|
_ws.closeAll();
|
||||||
|
_ws.enable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebApiWsConsoleClass::wsCleanupTaskCb()
|
void WebApiWsConsoleClass::wsCleanupTaskCb()
|
||||||
|
|||||||
@ -50,8 +50,11 @@ void WebApiWsLiveClass::reload()
|
|||||||
|
|
||||||
if (config.Security.AllowReadonly) { return; }
|
if (config.Security.AllowReadonly) { return; }
|
||||||
|
|
||||||
|
_ws.enable(false);
|
||||||
_simpleDigestAuth.setPassword(config.Security.Password);
|
_simpleDigestAuth.setPassword(config.Security.Password);
|
||||||
_ws.addMiddleware(&_simpleDigestAuth);
|
_ws.addMiddleware(&_simpleDigestAuth);
|
||||||
|
_ws.closeAll();
|
||||||
|
_ws.enable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebApiWsLiveClass::wsCleanupTaskCb()
|
void WebApiWsLiveClass::wsCleanupTaskCb()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user