From 3bcd5827f9e2e2b65ac6cb2c91717d5f4ae7e4a2 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 21 Jun 2025 14:38:48 -0700 Subject: [PATCH] chore(webui): unset nonce when logging out (#2242) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2242 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/services/webService.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/webService.ts b/src/services/webService.ts index 5a9251d2..92578c61 100644 --- a/src/services/webService.ts +++ b/src/services/webService.ts @@ -176,7 +176,17 @@ const wsOnConnect = (ws: ws, _req: http.IncomingMessage): void => { } } if (data.logout) { + const accountId = (ws as IWsCustomData).accountId; (ws as IWsCustomData).accountId = undefined; + await Account.updateOne( + { + _id: accountId, + ClientType: "webui" + }, + { + Nonce: 0 + } + ); } }); };