ignore 'undefined' rather than stringify
This commit is contained in:
parent
67d589f6cf
commit
2199d78451
|
@ -16,9 +16,15 @@
|
||||||
var qs = [];
|
var qs = [];
|
||||||
|
|
||||||
Object.keys(params).forEach(function (key) {
|
Object.keys(params).forEach(function (key) {
|
||||||
|
// TODO nullify instead?
|
||||||
|
if ('undefined' === typeof params[key]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ('scope' === key) {
|
if ('scope' === key) {
|
||||||
params[key] = core.stringifyscope(params[key]);
|
params[key] = core.stringifyscope(params[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
qs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
|
qs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -182,6 +188,10 @@
|
||||||
var clientId = opts.appId || opts.clientId;
|
var clientId = opts.appId || opts.clientId;
|
||||||
|
|
||||||
var args = directive.otp;
|
var args = directive.otp;
|
||||||
|
if (!directive.otp) {
|
||||||
|
console.log('[debug] loginCode directive:');
|
||||||
|
console.log(directive);
|
||||||
|
}
|
||||||
var params = {
|
var params = {
|
||||||
"username": opts.id || opts.username
|
"username": opts.id || opts.username
|
||||||
, "request_otp": true // opts.requestOtp || undefined
|
, "request_otp": true // opts.requestOtp || undefined
|
||||||
|
|
Loading…
Reference in New Issue