Hotfix instagram api (#6922)
* updated defaultURL to allow new insta API access * updated defaultURL to allow new insta API access * updates tests for new instagram API url Co-authored-by: Tim Talbot <tim@dyingmethod.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// Helper functions for accessing the instagram API.
|
||||
var Parse = require('parse/node').Parse;
|
||||
const httpsRequest = require('./httpsRequest');
|
||||
const defaultURL = 'https://api.instagram.com/v1/';
|
||||
const defaultURL = 'https://graph.instagram.com/';
|
||||
|
||||
// Returns a promise that fulfills iff this user id is valid.
|
||||
// Returns a promise that fulfills if this user id is valid.
|
||||
function validateAuthData(authData) {
|
||||
const apiURL = authData.apiURL || defaultURL;
|
||||
const path = `${apiURL}users/self/?access_token=${authData.access_token}`;
|
||||
const path = `${apiURL}me?fields=id&access_token=${authData.access_token}`;
|
||||
return httpsRequest.get(path).then(response => {
|
||||
if (response && response.data && response.data.id == authData.id) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user