From f6e9cd6c3849b40f1d4af5532708624412cf7e6f Mon Sep 17 00:00:00 2001 From: Aris <64918822+Arisamiga@users.noreply.github.com> Date: Mon, 11 Dec 2023 20:38:49 +0000 Subject: [PATCH] Updated to use Linkedin's userinfo --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 91b08c1..8223764 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ const embedImage = core.getInput("embed_image"); function getLinkedinId(accessToken) { return new Promise((resolve, reject) => { const hostname = "api.linkedin.com"; - const path = "/v2/me"; + const path = "/v2/userinfo"; const method = "GET"; const headers = { Authorization: "Bearer " + accessToken, @@ -23,7 +23,7 @@ function getLinkedinId(accessToken) { const body = ""; _request(method, hostname, path, headers, body) .then((r) => { - resolve(JSON.parse(r.body).id); + resolve(JSON.parse(r.body).sub); }) .catch((e) => reject(e)); });