mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-02 11:36:27 -04:00
implement no auth
This commit is contained in:
parent
33d7f8645a
commit
6f868c9ec3
3 changed files with 58 additions and 35 deletions
|
@ -26,7 +26,7 @@ console.log("Importing this project modules");
|
|||
debug("Importing Monitor");
|
||||
const Monitor = require("./model/monitor");
|
||||
debug("Importing Settings");
|
||||
const { getSettings, setSettings } = require("./util-server");
|
||||
const { getSettings, setSettings, setting } = require("./util-server");
|
||||
debug("Importing Notification");
|
||||
const { Notification } = require("./notification");
|
||||
debug("Importing Database");
|
||||
|
@ -114,6 +114,11 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
|
|||
socket.emit("setup")
|
||||
}
|
||||
|
||||
if (await setting("disableAuth")) {
|
||||
console.log("Disabled Auth: auto login to admin")
|
||||
await afterLogin(socket, await R.findOne("user", " username = 'admin' "))
|
||||
}
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
totalClient--;
|
||||
});
|
||||
|
@ -600,6 +605,8 @@ async function afterLogin(socket, user) {
|
|||
}
|
||||
|
||||
sendNotificationList(socket)
|
||||
|
||||
socket.emit("autoLogin")
|
||||
}
|
||||
|
||||
async function getMonitorJSONList(userID) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue