fix(vkontakte auth adapter): replace deadlocked promise with a live one (#3956)
This commit is contained in:
committed by
Florent Vilmart
parent
fedb381925
commit
91193c77eb
@@ -23,14 +23,15 @@ function validateAuthData(authData, params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vkOAuth2Request(params) {
|
function vkOAuth2Request(params) {
|
||||||
var promise = new Parse.Promise();
|
return new Promise(function (resolve) {
|
||||||
return promise.then(function(){
|
|
||||||
if (!params || !params.appIds || !params.appIds.length || !params.appSecret || !params.appSecret.length) {
|
if (!params || !params.appIds || !params.appIds.length || !params.appSecret || !params.appSecret.length) {
|
||||||
logger.error('Vk Auth', 'Vk auth is not configured. Missing appIds or appSecret.');
|
logger.error('Vk Auth', 'Vk auth is not configured. Missing appIds or appSecret.');
|
||||||
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Vk auth is not configured. Missing appIds or appSecret.');
|
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Vk auth is not configured. Missing appIds or appSecret.');
|
||||||
}
|
}
|
||||||
return request("oauth.vk.com", "access_token?client_id=" + params.appIds + "&client_secret=" + params.appSecret + "&v=5.59&grant_type=client_credentials")
|
resolve();
|
||||||
})
|
}).then(function () {
|
||||||
|
return request("oauth.vk.com", "access_token?client_id=" + params.appIds + "&client_secret=" + params.appSecret + "&v=5.59&grant_type=client_credentials");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a promise that fulfills iff this app id is valid.
|
// Returns a promise that fulfills iff this app id is valid.
|
||||||
|
|||||||
Reference in New Issue
Block a user