vvanghelue / digits-server-client Goto Github PK
View Code? Open in Web Editor NEWNode.js alternative to Digits web "SDK"
Node.js alternative to Digits web "SDK"
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
Lines 198 to 200 in cde9d57
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
Hey @vvanghelue ,
thanks for reverse engineering the digits sdk ;) This looks quite nice. Did you find a way to logout from digits?
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.
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 ?
You have some idea to continue using this library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.