diff --git a/src/services/webService.ts b/src/services/webService.ts index 2f5f3e3f..8beda45c 100644 --- a/src/services/webService.ts +++ b/src/services/webService.ts @@ -97,7 +97,7 @@ export const stopWebServer = async (): Promise => { }; interface IWsCustomData extends ws { - accountId: string; + accountId?: string; } interface IWsMsgFromClient { @@ -106,6 +106,7 @@ interface IWsMsgFromClient { password: string; isRegister: boolean; }; + logout?: boolean; } interface IWsMsgToClient { @@ -173,6 +174,9 @@ const wsOnConnect = (ws: ws, _req: http.IncomingMessage): void => { ); } } + if (data.logout) { + (ws as IWsCustomData).accountId = undefined; + } }); }; diff --git a/static/webui/index.html b/static/webui/index.html index 5b92f727..1a748968 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -37,7 +37,7 @@