fix dropInEvents/SMTP trigger authentication

merge-requests/81/head
Moe 2019-07-30 07:31:01 -07:00
parent 934159786a
commit ec2e5eae9d
2 changed files with 15 additions and 5 deletions

View File

@ -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)
}
}
}

View File

@ -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)