Browse Source

update token object path

niemes 2 years ago
parent
commit
47f6a06cdb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/API.js

+ 2 - 2
lib/API.js

@@ -9,7 +9,7 @@ class API {
         return new Promise((resolve, reject) => {
             const url = 'https://api.linkedin.com/v2/me';
             const headers = {
-                'Authorization': 'Bearer ' + info.token,
+                'Authorization': 'Bearer ' + info.token.access_token,
                 'cache-control': 'no-cache',
                 'X-Restli-Protocol-Version': '2.0.0' 
             };
@@ -28,7 +28,7 @@ class API {
             const param = encodeURIComponent(`urn:li:organization:`)+info.companyID+'?edgeType=CompanyFollowedByMember'
             const url = `https://api.linkedin.com/v2/networkSizes/${param}`;
             const headers = {
-                'Authorization': 'Bearer ' + info.token,
+                'Authorization': 'Bearer ' + info.token.access_token,
                 'cache-control': 'no-cache',
                 'X-Restli-Protocol-Version': '2.0.0' 
             };