update localdb backend interface,

update all references to localdb backend
This commit is contained in:
2024-04-09 21:02:41 +00:00
parent 98479205d9
commit 3ddd1f62d7
12 changed files with 152 additions and 42 deletions

View File

@@ -167,7 +167,10 @@ if (schemes.interrupt.enabled) {
else {
wsServer.handleUpgrade(req, socket, head, (socket) => {
// get the user pools
const pools = global.db.getUser(cookies.username).cluster.pools;
const userRealm = cookies.username.split("@").at(-1);
const userID = cookies.username.replace(`@${userRealm}`, "");
const userObj = { id: userID, realm: userRealm };
const pools = Object.keys(global.db.getUser(userObj).cluster.pools);
// emit the connection to initialize socket
wsServer.emit("connection", socket, cookies.username, pools);
});