Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions defaults/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ module.exports = {
//
public: true,

//
// Exec command when invalid password was entered.
// Keyword {user} will be replaced with login name.
// Use it to report bad login attempts.
//
// @type string
// @default ""
//
authErrorCmd: "",

//
// Allow connections from this host.
//
Expand Down
4 changes: 4 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ function auth(data) {
}
});
if (!success) {
if (data.user !== undefined && config.authErrorCmd) {
var error_cmd = require("child_process");
error_cmd.execSync(config.authErrorCmd.replace(/\{user}/g, data.user));
}
socket.emit("auth");
}
}
Expand Down