Skip to content

Commit

Permalink
fixed linkedin profile picture issue (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
krankos authored Jun 23, 2023
1 parent 5f9ad02 commit 1d7d359
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/oauth/src/providers/linkedin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ export const linkedin = <_Auth extends Auth>(auth: _Auth, config: Config) => {

const getProviderUser = async (accessToken: string) => {
const linkedinProfile = await getProfile(accessToken);
const displayImageElement = linkedinProfile.profilePicture[
"displayImage~"
]?.elements
?.slice(-1)
?.pop();
const displayImageElement = linkedinProfile?.profilePicture?.["displayImage~"]?.elements
?.slice(-1)
?.pop() ?? null;
const linkedinUser: LinkedinUser = {
id: linkedinProfile.id,
firstName: linkedinProfile.localizedFirstName,
Expand Down

0 comments on commit 1d7d359

Please sign in to comment.