ignore 'undefined' rather than stringify

This commit is contained in:
AJ ONeal 2017-01-18 16:24:30 -05:00
parent 67d589f6cf
commit 2199d78451
1 changed files with 10 additions and 0 deletions

View File

@ -16,9 +16,15 @@
var qs = [];
Object.keys(params).forEach(function (key) {
// TODO nullify instead?
if ('undefined' === typeof params[key]) {
return;
}
if ('scope' === key) {
params[key] = core.stringifyscope(params[key]);
}
qs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
});
@ -182,6 +188,10 @@
var clientId = opts.appId || opts.clientId;
var args = directive.otp;
if (!directive.otp) {
console.log('[debug] loginCode directive:');
console.log(directive);
}
var params = {
"username": opts.id || opts.username
, "request_otp": true // opts.requestOtp || undefined