Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auth0-ext-compilers

Package Overview
Dependencies
Maintainers
40
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth0-ext-compilers - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

.github/workflows/push.yml

11

lib/compilers/send-phone-message.js

@@ -6,4 +6,13 @@ 'use strict';

module.exports = Factory.createCompiler(sendPhoneMessageHandler);
const ExtensibilityUserError = require('../errors/ExtensibilityUserError');
class SendPhoneMessageError extends ExtensibilityUserError {
constructor(message, friendlyMessage) {
super(message);
this.friendlyMessage = friendlyMessage || message;
}
}
module.exports = Factory.createCompiler(sendPhoneMessageHandler, [SendPhoneMessageError]);
function sendPhoneMessageHandler (func, webtaskContext, cb) {

@@ -10,0 +19,0 @@ return Authz.is_authorized(webtaskContext, error => {

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "6.0.0",
"version": "6.1.0",
"description": "Webtask compilers for Auth0 platform extensibility points",

@@ -11,0 +11,0 @@ "engines": {

@@ -589,3 +589,43 @@ /* eslint-env node, mocha */

});
it('provides a custom error object', function (done) {
compiler({
nodejsCompiler,
script: 'module.exports = function(recipient, text, context, cb) { cb(new SendPhoneMessageError("e1", "e2")); };'
}, function (error, func) {
Assert.ifError(error);
simulate(func, {
body: {
recipient: '1-999-888-657-2134', text: 'dis iz a text', context: {
message_type: 'sms',
action: 'second-factor-authentication',
language: 'korean',
code: 'SOMEOTP12345',
ip: '127.0.0.1',
user_agent: 'someAgent',
user: {},
client: {
client_id: 'someClientId',
name: 'Test Application',
client_metadata: {}
}
}
},
headers: {},
method: 'POST',
}, function (error, envelope) {
Assert.ifError(error);
const { status, data } = envelope;
Assert.equal(status, 'error');
Assert.equal(data.name, 'SendPhoneMessageError');
Assert.equal(data.message, 'e1');
Assert.equal(data.friendlyMessage, 'e2');
done();
});
});
});
}); // valid payload
});
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