New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bip-pod-email

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bip-pod-email - npm Package Compare versions

Comparing version 0.3.12 to 0.3.13

2

package.json
{
"name": "bip-pod-email",
"version": "0.3.12",
"version": "0.3.13",
"author": "Michael Pearson",

@@ -5,0 +5,0 @@ "description": "Email Pod for Bipio",

@@ -90,2 +90,3 @@ /**

$resource.dao.create(model, function(err, result) {
// ask the user to verify they'll accept messages

@@ -95,3 +96,4 @@ if (!err && result) {

// this email to verify against.
if (podConfig.verify_from !== 'none') {
if (podConfig.verify_from !== 'none') {
$resource.dao.createBip({

@@ -120,2 +122,3 @@ type : 'http',

function(err, modelName, bip) {
if (!err) {

@@ -212,84 +215,88 @@ sendVerifyEmail(

dao.findFilter(
modelName,
{
'email_verify' : channel.config.rcpt_to
},
function(err, results) {
var verified = false, pending = false, verifyObj, hash, model;
if (err) {
next(err, 'channel', channel, 500);
} else {
if (!results) {
createVerifyObject(
$resource,
modelName,
channel,
accountInfo,
next
);
if (app.helper.getRegUUID().test(channel.id)) {
dao.findFilter(
modelName,
{
'email_verify' : channel.config.rcpt_to
},
function(err, results) {
var verified = false, pending = false, verifyObj, hash, model;
if (err) {
next(err, 'channel', channel, 500);
} else {
// iterate over results.
//
var finalMode, result;
if (!results) {
createVerifyObject(
$resource,
modelName,
channel,
accountInfo,
next
);
} else {
// iterate over results.
//
var finalMode, result;
for (var idx in results) {
result = results[idx];
// if there's a global deny, then bounce it
if (result.mode == 'no_global') {
finalMode = 'no_global';
}
for (var idx in results) {
result = results[idx];
// if there's a global deny, then bounce it
if (result.mode == 'no_global') {
finalMode = 'no_global';
}
// if we find a pending request from this user,
// then it should still be pending
if (result.owner_id == channel.owner_id) {
if (result.mode == 'accept' || (!finalMode && result.mode == 'pending')) {
finalMode = result.mode;
// we break on 'accept', but give the opportunity
// to find a 'no_global' catch. Or in other words,
// no_global invalidates any pending requests
if (finalMode == 'accept') {
break;
// if we find a pending request from this user,
// then it should still be pending
if (result.owner_id == channel.owner_id) {
if (result.mode == 'accept' || (!finalMode && result.mode == 'pending')) {
finalMode = result.mode;
// we break on 'accept', but give the opportunity
// to find a 'no_global' catch. Or in other words,
// no_global invalidates any pending requests
if (finalMode == 'accept') {
break;
}
}
}
}
}
// create a verification message for this user -> recipient
if (!finalMode) {
createVerifyObject($resource, modelName, channel, accountInfo, next);
// create a verification message for this user -> recipient
if (!finalMode) {
createVerifyObject($resource, modelName, channel, accountInfo, next);
} else if (finalMode == 'no_global') {
// forbidden channels are deleted
dao.remove('channel', channel.id, accountInfo);
var errorPacket = {
'config.rcpt_to' : {
'message' : 'Recipient Unavailable'
}
};
next(err, {
'status' : 403,
'message' : 'ValidationError',
'errors' : errorPacket
}, 403); // forbidden
} else if (finalMode == 'no_global') {
// forbidden channels are deleted
dao.remove('channel', channel.id, accountInfo);
var errorPacket = {
'config.rcpt_to' : {
'message' : 'Recipient Unavailable'
}
};
next(err, {
'status' : 403,
'message' : 'ValidationError',
'errors' : errorPacket
}, 403); // forbidden
} else if (finalMode == 'accept') {
next(err, 'channel', channel, 200); // ok
} else if (finalMode == 'accept') {
next(err, 'channel', channel, 200); // ok
} else if (finalMode == 'pending') {
channel._available = ($resource.podConfig.verify_required !== undefined ? !($resource.podConfig.verify_required) : false);
} else if (finalMode == 'pending') {
channel._available = ($resource.podConfig.verify_required !== undefined ? !($resource.podConfig.verify_required) : false);
dao.updateColumn('channel', channel.id, {
'_available' : channel._available
}, function(err, result) {
if (err) {
$resource.log(err, channel, 'error');
}
next(err, 'channel', channel, (err) ? 500 : 202); // deferred
});
dao.updateColumn('channel', channel.id, {
'_available' : channel._available
}, function(err, result) {
if (err) {
$resource.log(err, channel, 'error');
}
next(err, 'channel', channel, (err) ? 500 : 202); // deferred
});
}
}
}
}
}
);
);
} else {
next(false, 'channel', channel, 200);
}
};

@@ -296,0 +303,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc