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) {
23
23
}
24
24
25
25
function vkOAuth2Request ( params ) {
26
- var promise = new Parse . Promise ( ) ;
27
- return promise . then ( function ( ) {
26
+ return new Promise ( function ( resolve ) {
28
27
if ( ! params || ! params . appIds || ! params . appIds . length || ! params . appSecret || ! params . appSecret . length ) {
29
28
logger . error ( 'Vk Auth' , 'Vk auth is not configured. Missing appIds or appSecret.' ) ;
30
29
throw new Parse . Error ( Parse . Error . OBJECT_NOT_FOUND , 'Vk auth is not configured. Missing appIds or appSecret.' ) ;
31
30
}
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
+ } ) ;
34
35
}
35
36
36
37
// Returns a promise that fulfills iff this app id is valid.
You can’t perform that action at this time.
0 commit comments