fix dropInEvents/SMTP trigger authentication
parent
934159786a
commit
ec2e5eae9d
10
libs/auth.js
10
libs/auth.js
|
@ -279,9 +279,15 @@ module.exports = function(s,config,lang){
|
|||
s.basicOrApiAuthentication = function(username,password,callback){
|
||||
var splitUsername = username.split('@')
|
||||
if(splitUsername[1] && splitUsername[1].toLowerCase().indexOf('shinobi') > -1){
|
||||
getApiKey(params,'ke,uid',callback)
|
||||
getApiKey({
|
||||
auth: splitUsername,
|
||||
ke: password
|
||||
},'ke,uid',callback)
|
||||
}else{
|
||||
loginWithUsernameAndPassword(params,'ke,uid',callback)
|
||||
loginWithUsernameAndPassword({
|
||||
username: username,
|
||||
password: password
|
||||
},'ke,uid',callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,9 +104,13 @@ module.exports = function(s,config,lang,app,io){
|
|||
var eventTrigger = function(eventType,filename,stats){
|
||||
if(stats.isDirectory()){
|
||||
fs.readdir(monitorEventDropDir + filename,function(err,files){
|
||||
if(files){
|
||||
files.forEach(function(filename){
|
||||
processFile(filename)
|
||||
})
|
||||
}else if(err){
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
processFile(filename)
|
||||
|
|
Loading…
Reference in New Issue