ignore 'undefined' rather than stringify
This commit is contained in:
		
							parent
							
								
									67d589f6cf
								
							
						
					
					
						commit
						2199d78451
					
				@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user