Giter Site home page Giter Site logo

digits-server-client's People

Contributors

blackyoup avatar iam-medvedev avatar vvanghelue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

digits-server-client's Issues

[Bug]: error is undefined when invalid verifyCode is submitted for verification

In order to find why error is undefined i viewed index.js and found that your are assigning

if (jsonBody.errors) {
   resolve({success: false, phone: token.phoneNumber, errors: errors});
}

errros:errors instead of errors:jsonBody.errors.

You can find above code over here

if (jsonBody.errors) {
resolve({success: false, phone: token.phoneNumber, errors: errors});
}

UnhandledPromiseRejectionWarning

Hello,

I am receiving the warning below although the sendVerificationCode function is working properly and I am receiving the registrationToken, any idea?

(node:54611) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ValidationError

logout

Hey @vvanghelue ,

thanks for reverse engineering the digits sdk ;) This looks quite nice. Did you find a way to logout from digits?

some error?

hello,i use it in my express server,then receive this error message
i don't what's problem with my server.

var express = require('express');
var router = express.Router();
var digitsClient = require('digits-server-client');
var digits = new digitsClient({
    digitsConsumerKey: '6r0jJn986AbE54Qgog4FBId8t',
    digitsHost: "http://www.webhunt.cn"
});
/* GET home page. */
router.get('/', function(req, res, next) {
	digits.sendVerificationCode({
	    phoneNumber: '1363264XXXX',
	    countryCode: 'CN'
	}).then(function (registrationToken) {
	    //eyJsb2dpblZlcmlmaWNhdGlvblJlcXVlc3RJZCI6InV... 
	    console.log(registrationToken);
	}).then(null, function (error) {
	    //error 
	    console.log(error);
	});
	// res.redirect("/users")
  res.render('index', { title: 'Express' });
});

module.exports = router;

receive this message

Unable to parse Digits cookies or authenticityToken in html.

Check for given arguments for sendVerificationCode

Hi,

Currently, when this method is called, it doesn't check for arguments validity. For example, if one omits the header field, an error will be raised (can't read property accept-languages of undefined) and the program will crash. Also, this doesn't make much sense if the phoneNumber field is omitted too.

I would be glad to open a PR for this but how do you want to handle this ? Return a rejected Promise with an error describing the troubles or directly throw into the method ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.