bmw-token-manager
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -15,13 +15,15 @@ 'use strict'; | ||
const refreshFacebookAccessToken = async (currentAccessToken, oauthOptions) => { | ||
const response = await fetch("https://graph.facebook.com/v14.0/oauth/access_token", { | ||
const baseUrl = "https://graph.facebook.com/v14.0/oauth/access_token"; | ||
const searchParams = new URLSearchParams({ | ||
grant_type: "fb_exchange_token", | ||
client_id: oauthOptions.facebookClientId, | ||
client_secret: oauthOptions.facebookClientSecret, | ||
fb_exchange_token: currentAccessToken, | ||
}); | ||
const url = `${baseUrl}?${searchParams.toString()}`; | ||
const response = await fetch(url, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
}, | ||
body: new URLSearchParams({ | ||
grant_type: "fb_exchange_token", | ||
client_id: oauthOptions.facebookClientId, | ||
client_secret: oauthOptions.facebookClientSecret, | ||
fb_exchange_token: currentAccessToken, | ||
}), | ||
} | ||
}); | ||
@@ -31,11 +33,13 @@ return await response.json(); | ||
const refreshInstagramLongLivedToken = async (longLivedToken) => { | ||
const response = await fetch("https://graph.instagram.com/refresh_access_token", { | ||
const baseUrl = "https://graph.instagram.com/refresh_access_token"; | ||
const searchParams = new URLSearchParams({ | ||
grant_type: "ig_refresh_token", | ||
access_token: longLivedToken, | ||
}); | ||
const url = `${baseUrl}?${searchParams.toString()}`; | ||
const response = await fetch(url, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
}, | ||
body: new URLSearchParams({ | ||
grant_type: "ig_refresh_token", | ||
access_token: longLivedToken, | ||
}), | ||
} | ||
}); | ||
@@ -42,0 +46,0 @@ return await response.json(); |
@@ -13,13 +13,15 @@ async function registerFetchAttempt(supabaseClient, activeTeamId) { | ||
const refreshFacebookAccessToken = async (currentAccessToken, oauthOptions) => { | ||
const response = await fetch("https://graph.facebook.com/v14.0/oauth/access_token", { | ||
const baseUrl = "https://graph.facebook.com/v14.0/oauth/access_token"; | ||
const searchParams = new URLSearchParams({ | ||
grant_type: "fb_exchange_token", | ||
client_id: oauthOptions.facebookClientId, | ||
client_secret: oauthOptions.facebookClientSecret, | ||
fb_exchange_token: currentAccessToken, | ||
}); | ||
const url = `${baseUrl}?${searchParams.toString()}`; | ||
const response = await fetch(url, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
}, | ||
body: new URLSearchParams({ | ||
grant_type: "fb_exchange_token", | ||
client_id: oauthOptions.facebookClientId, | ||
client_secret: oauthOptions.facebookClientSecret, | ||
fb_exchange_token: currentAccessToken, | ||
}), | ||
} | ||
}); | ||
@@ -29,11 +31,13 @@ return await response.json(); | ||
const refreshInstagramLongLivedToken = async (longLivedToken) => { | ||
const response = await fetch("https://graph.instagram.com/refresh_access_token", { | ||
const baseUrl = "https://graph.instagram.com/refresh_access_token"; | ||
const searchParams = new URLSearchParams({ | ||
grant_type: "ig_refresh_token", | ||
access_token: longLivedToken, | ||
}); | ||
const url = `${baseUrl}?${searchParams.toString()}`; | ||
const response = await fetch(url, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
}, | ||
body: new URLSearchParams({ | ||
grant_type: "ig_refresh_token", | ||
access_token: longLivedToken, | ||
}), | ||
} | ||
}); | ||
@@ -40,0 +44,0 @@ return await response.json(); |
{ | ||
"name": "bmw-token-manager", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"repository": "git@github.com:imbhargav5/bmw-token-manager.git", | ||
@@ -5,0 +5,0 @@ "author": "Bhargav Ponnapalli <imbhargav5@gmail.com>", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
248176
1750