-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linkedin): wip add linkedin v2 (#3001)
* feat(linkedin): wip add linkedin v2 * feat(linkedin): add linkedin v2) * feat(linkedin): remove linkedin verified email * feat(linkedin): display linkedin V1 only if user already claimed it * remove deprecated label * feat(linkedin): update linkedin V2 description * feat(linkedin): update linkedin V2 stamp * feat(linkedin): update linkedin stamp * feat(linkedin): update platform map
- Loading branch information
Showing
7 changed files
with
52 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,12 @@ const mockedAxios = axios as jest.Mocked<typeof axios>; | |
|
||
const validLinkedinUserResponse = { | ||
data: { | ||
id: "18723656", | ||
firstName: "First", | ||
lastName: "Last", | ||
sub: "18723656", | ||
email_verified: true, | ||
name: "Foo", | ||
given_name: "Foo", | ||
family_name: "Bar", | ||
email: "[email protected]", | ||
}, | ||
status: 200, | ||
}; | ||
|
@@ -41,10 +44,10 @@ 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; | ||
const clientId = process.env.LINKEDIN_CLIENT_ID_V2; | ||
const clientSecret = process.env.LINKEDIN_CLIENT_SECRET_V2; | ||
const linkedin = new LinkedinProvider(); | ||
const linkedinPayload = await linkedin.verify({ | ||
proofs: { | ||
|
@@ -62,15 +65,15 @@ describe("Attempt verification", function() { | |
); | ||
|
||
// Check the request to get the user | ||
expect(mockedAxios.get).toHaveBeenCalledWith("https://api.linkedin.com/v2/me", { | ||
expect(mockedAxios.get).toHaveBeenCalledWith("https://api.linkedin.com/v2/userinfo", { | ||
headers: { Authorization: "Bearer 762165719dhiqudgasyuqwt6235", "Linkedin-Version": 202305 }, | ||
}); | ||
|
||
expect(linkedinPayload).toEqual({ | ||
valid: true, | ||
errors: [], | ||
record: { | ||
id: validLinkedinUserResponse.data.id, | ||
sub: validLinkedinUserResponse.data.sub, | ||
}, | ||
}); | ||
}); | ||
|
@@ -94,9 +97,12 @@ describe("Attempt verification", function() { | |
mockedAxios.get.mockImplementation(async () => { | ||
return { | ||
data: { | ||
id: undefined, | ||
firstName: "First", | ||
lastName: "Last", | ||
sub: undefined, | ||
email_verified: false, | ||
name: "Foo", | ||
given_name: "Foo", | ||
family_name: "Bar", | ||
email: "[email protected]", | ||
}, | ||
status: 200, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters