Skip to content

Commit 5bd06e1

Browse files
committed
disconnect db locked users
1 parent 6c65ad5 commit 5bd06e1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,11 +1954,16 @@ export class Message {
19541954
} else if (cli?.clientagent == "openrpa" && msg.user.dblocked == true) {
19551955
// await Audit.LoginFailed(msg.user.username, type, "websocket", cli?.remoteip, cli?.clientagent, cli?.clientversion, span);
19561956
Logger.instanse.error("Message", "Signin", msg.user.username + " is dblocked");
1957-
// msg.error = "User is dblocked, please login to openflow and buy more storage and try again";
1958-
// msg.jwt = undefined;
1957+
// Dillema ....
1958+
// If we send an error or empy yser, the robot will spam new tabs
1959+
// If we just close the connection the user will not know what is wrong ...
1960+
msg.error = "User is dblocked, please login to openflow and buy more storage and try again";
1961+
msg.jwt = undefined;
1962+
msg.user = undefined;
19591963
// Stall a little, to avoid spam
1960-
// await new Promise(resolve => { setTimeout(resolve, 5000) });
1964+
await new Promise(resolve => { setTimeout(resolve, 5000) });
19611965
//
1966+
cli.Close();
19621967
// setTimeout(() => {
19631968
// cli.Close();
19641969
// }, 500);

0 commit comments

Comments
 (0)