mirror of
				https://git.coolaj86.com/coolaj86/telebit.js.git
				synced 2025-10-30 22:32:46 +00:00 
			
		
		
		
	send error if response is weird
This commit is contained in:
		
							parent
							
								
									0a14bbd84c
								
							
						
					
					
						commit
						3e4b25b1f6
					
				| @ -182,6 +182,13 @@ common.api.token = function (state, handlers) { | ||||
|               //console.log('[debug] first req');
 | ||||
|               handlers.requested(authReq, function () { | ||||
|                 handlers.connect(body.access_token || body.jwt, function () { | ||||
|                   var err; | ||||
|                   if (!resp.headers.location) { | ||||
|                     err = new Error("bad authentication request response"); | ||||
|                     err._resp = resp.toJSON(); | ||||
|                     handlers.error(err, function () {}); | ||||
|                     return; | ||||
|                   } | ||||
|                   setTimeout(gotoNext, 2 * 1000, { url: resp.headers.location, json: true }); | ||||
|                 }); | ||||
|               }); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user