Skip to content

Commit 91193c7

Browse files
denistrofimovflovilmart
authored andcommitted
fix(vkontakte auth adapter): replace deadlocked promise with a live one (#3956)
1 parent fedb381 commit 91193c7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Adapters/Auth/vkontakte.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ function validateAuthData(authData, params) {
2323
}
2424

2525
function 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.

0 commit comments

Comments
 (0)