diff --git a/platforms/src/Linkedin/Providers/linkedin.ts b/platforms/src/Linkedin/Providers/linkedin.ts index 41586ddf72..048edb82fe 100644 --- a/platforms/src/Linkedin/Providers/linkedin.ts +++ b/platforms/src/Linkedin/Providers/linkedin.ts @@ -96,7 +96,7 @@ const verifyLinkedin = async (code: string): Promise // retrieve user's auth bearer token to authenticate client const accessToken = await requestAccessToken(code); // Now that we have an access token fetch the user details - const userRequest = await axios.get("https://api.linkedin.com/rest/me", { + const userRequest = await axios.get("https://api.linkedin.com/v2/me", { headers: { Authorization: `Bearer ${accessToken}`, "Linkedin-Version": 202305, diff --git a/platforms/src/Linkedin/__tests__/linkedin.test.ts b/platforms/src/Linkedin/__tests__/linkedin.test.ts index dadd60c4d3..8e36ea6ccd 100644 --- a/platforms/src/Linkedin/__tests__/linkedin.test.ts +++ b/platforms/src/Linkedin/__tests__/linkedin.test.ts @@ -41,7 +41,7 @@ beforeEach(() => { }); }); -describe("Attempt verification", function () { +describe("Attempt verification", function() { it("handles valid verification attempt", async () => { const clientId = process.env.LINKEDIN_CLIENT_ID; const clientSecret = process.env.LINKEDIN_CLIENT_SECRET; @@ -62,7 +62,7 @@ describe("Attempt verification", function () { ); // Check the request to get the user - expect(mockedAxios.get).toHaveBeenCalledWith("https://api.linkedin.com/rest/me", { + expect(mockedAxios.get).toHaveBeenCalledWith("https://api.linkedin.com/v2/me", { headers: { Authorization: "Bearer 762165719dhiqudgasyuqwt6235", "Linkedin-Version": 202305 }, });