Skip to content

Commit 35fe088

Browse files
committed
Instagram authentication for the case when data child object is presented in the response
1 parent 8a4915b commit 35fe088

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Adapters/Auth/instagram.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ function validateAuthData(authData) {
88
const apiURL = authData.apiURL || defaultURL;
99
const path = `${apiURL}me?fields=id&access_token=${authData.access_token}`;
1010
return httpsRequest.get(path).then(response => {
11-
if (response && response.id == authData.id) {
11+
const user = response.data ? response.data : response
12+
if (user && user.id == authData.id) {
1213
return;
1314
}
1415
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Instagram auth is invalid for this user.');

0 commit comments

Comments
 (0)