mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
auth/login should return empty object when insecure
This commit is contained in:
@@ -74,9 +74,12 @@ function getToken(req,res,next) {
|
||||
}
|
||||
|
||||
function login(req,res) {
|
||||
var response = {
|
||||
"type":"credentials",
|
||||
"prompts":[{id:"username",type:"text",label:"Username"},{id:"password",type:"password",label:"Password"}]
|
||||
var response = {};
|
||||
if (settings.adminAuth) {
|
||||
response = {
|
||||
"type":"credentials",
|
||||
"prompts":[{id:"username",type:"text",label:"Username"},{id:"password",type:"password",label:"Password"}]
|
||||
}
|
||||
}
|
||||
res.json(response);
|
||||
}
|
||||
|
@@ -51,6 +51,8 @@ function init(adminApp,storage) {
|
||||
|
||||
adminApp.use(express.json());
|
||||
adminApp.use(express.urlencoded());
|
||||
|
||||
adminApp.get("/auth/login",auth.login);
|
||||
|
||||
if (settings.adminAuth) {
|
||||
//TODO: all passport references ought to be in ./auth
|
||||
@@ -61,7 +63,6 @@ function init(adminApp,storage) {
|
||||
auth.getToken,
|
||||
auth.errorHandler
|
||||
);
|
||||
adminApp.get("/auth/login",auth.login);
|
||||
adminApp.post("/auth/revoke",auth.revoke);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user