k.niemeskern 2 năm trước cách đây
mục cha
commit
57fe8b664a
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 2 0
      index.js
  2. 2 1
      lib/API.js

+ 2 - 0
index.js

@@ -78,6 +78,8 @@ app.get('/callback', async (req, res) => {
         if(data.access_token) {
             info.token = data.access_token;
             info.authorized = true;
+            process.env.access_token = info.token
+            process.env.expire = data.expire ? data.expire : 0
         }
         res.redirect('/');
     } catch(err) {

+ 2 - 1
lib/API.js

@@ -25,7 +25,8 @@ class API {
 
     static getCompanyID(info) {
         return new Promise((resolve, reject) => {
-            const url = 'https://api.linkedin.com/v2/companySearch?q=search&query=spirit_3';
+            
+            const url = '"https://api.linkedin.com/v2/search?q=companiesV2&baseSearchParams.keywords=spirit_3"';
             const headers = {
                 'Authorization': 'Bearer ' + info.token,
                 'cache-control': 'no-cache',