From bcbd2c7f0d665649953283202dc1e64386ab1477 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 09:28:26 +0200 Subject: [PATCH] improve: never automatically create an account for webui client --- src/controllers/api/loginController.ts | 2 +- static/webui/script.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 7dbef077..4cd7f6ef 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -18,7 +18,7 @@ const loginController: RequestHandler = async (request, response) => { const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 } - if (!account && config.autoCreateAccount) { + if (!account && config.autoCreateAccount && loginRequest.ClientType != "webui") { try { const newAccount = await createAccount({ email: loginRequest.email, diff --git a/static/webui/script.js b/static/webui/script.js index 6446c62c..48cddcb9 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -15,7 +15,7 @@ function loginFromLocalStorage() { s: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==", // signature of some kind lang: "en", date: 1501230947855458660, // ??? - ClientType: "", + ClientType: "webui", PS: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==" // anti-cheat data }) });