File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ function validateAuthData(authData, params) {
2323} 
2424
2525function  vkOAuth2Request ( params )  { 
26-   var  promise  =  new  Parse . Promise ( ) ; 
27-   return  promise . then ( function ( ) { 
26+   return  new  Promise ( function  ( resolve )  { 
2827    if  ( ! params  ||  ! params . appIds  ||  ! params . appIds . length  ||  ! params . appSecret  ||  ! params . appSecret . length )  { 
2928      logger . error ( 'Vk Auth' ,  'Vk auth is not configured. Missing appIds or appSecret.' ) ; 
3029      throw  new  Parse . Error ( Parse . Error . OBJECT_NOT_FOUND ,  'Vk auth is not configured. Missing appIds or appSecret.' ) ; 
3130    } 
32-     return  request ( "oauth.vk.com" ,  "access_token?client_id="  +  params . appIds  +  "&client_secret="  +  params . appSecret  +  "&v=5.59&grant_type=client_credentials" ) 
33-   } ) 
31+     resolve ( ) ; 
32+   } ) . then ( function  ( )  { 
33+     return  request ( "oauth.vk.com" ,  "access_token?client_id="  +  params . appIds  +  "&client_secret="  +  params . appSecret  +  "&v=5.59&grant_type=client_credentials" ) ; 
34+   } ) ; 
3435} 
3536
3637// Returns a promise that fulfills iff this app id is valid. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments