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

authy

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authy - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

21

index.js

@@ -12,7 +12,19 @@ var request = require('request');

Authy.prototype.register_user = function (email, cellphone, country_code, callback) {
Authy.prototype.register_user = function (email, cellphone, country_code, send_sms_install_link, callback) {
var country = "1";
if (arguments.length > 3) {
var send_install_link = true;
if (arguments.length > 4) {
country = country_code;
} else {
send_install_link = send_sms_install_link;
}
else if (arguments.length == 4) {
callback = send_sms_install_link;
if (typeof country_code == "boolean") {
send_install_link = country_code;
}
else {
country = country_code;
}
}
else {
callback = country_code;

@@ -29,3 +41,4 @@ }

qs: {
api_key: this.apiKey
api_key: this.apiKey,
send_install_link_via_sms: send_install_link
},

@@ -32,0 +45,0 @@ json: true,

4

package.json
{
"name": "authy",
"version": "0.2.1",
"version": "0.2.2",
"description": "Authy.com API lib for node.js",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"request": "2.33.0"
"request": "2.39.0"
},

@@ -30,0 +30,0 @@ "devDependencies": {

@@ -35,4 +35,5 @@ # node-authy [![Dependency Status](https://david-dm.org/evilpacket/node-authy.png)](https://david-dm.org/evilpacket/node-authy)

register_user(email, cellphone, [country_code], callback);
register_user(email, cellphone, [country_code], [send_install_link_via_sms], callback);
```javascript

@@ -44,2 +45,4 @@ authy.register_user('baldwin@andyet.net', '509-555-1212', function (err, res) {

If not given, `country_code` defaults to `"1"` and `send_install_link_via_sms` defaults to `true`.
Verify Token

@@ -46,0 +49,0 @@ ------------

@@ -16,3 +16,3 @@ var apikey = "0cd08abec2e9b9641e40e9470a7fc336";

*/
exports['Register New User - Without country code'] = function (test) {
exports['Register New User - Without country code or SMS install link param'] = function (test) {
authy.register_user(test_user.email, test_user.phone, function (err, res) {

@@ -27,3 +27,3 @@ test.ok(res);

exports['Register New User - With country code'] = function (test) {
exports['Register New User - With country code but no SMS install link param'] = function (test) {
authy.register_user(test_user.email, test_user.phone, test_user.country, function (err, res) {

@@ -36,2 +36,18 @@ test.ok(res);

exports['Register New User - With country code and SMS install link param'] = function (test) {
authy.register_user(test_user.email, test_user.phone, test_user.country, false, function (err, res) {
test.ok(res);
test.equal(typeof(res), 'object', 'Response should be an object.');
test.done();
});
};
exports['Register New User - With SMS install link param but no country code'] = function (test) {
authy.register_user(test_user.email, test_user.phone, false, function (err, res) {
test.ok(res);
test.equal(typeof(res), 'object', 'Response should be an object.');
test.done();
});
};
exports['Register New User - Blank Email'] = function (test) {

@@ -38,0 +54,0 @@ authy.register_user(null, test_user.phone, test_user.country, function (err, res) {

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