Merge pull request from GHSA-88j4-pcx8-q4q3

* WIP, still need to handle npm run reset-password

* Implement it for "npm run reset-password"

Bug fixes and change along with this commit
- Move `ssl`, `hostname`, `port` to ./server/config.js, so `reset-password` is able to read it
- Fix: FBSD is missing, no idea who dropped it.
- Fix: Frontend code should not require any backend code (./server/config.js), moved "badgeConstants" to the common util (./src/util.ts) and drop vite-common.js

* Minor
This commit is contained in:
Louis Lam 2023-12-10 20:40:40 +08:00 committed by GitHub
parent 2815cc73cf
commit 482049c72b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 170 additions and 54 deletions

View file

@ -78,4 +78,14 @@ module.exports.generalSocketHandler = (socket, server) => {
});
}
});
// Disconnect all other socket clients of the user
socket.on("disconnectOtherSocketClients", async () => {
try {
checkLogin(socket);
server.disconnectAllSocketClients(socket.userID, socket.id);
} catch (e) {
log.warn("disconnectAllSocketClients", e.message);
}
});
};