Skip to content

Commit

Permalink
fixing profile types in authkit provider
Browse files Browse the repository at this point in the history
  • Loading branch information
fierysolid committed Jan 16, 2025
1 parent 66fbe22 commit 8ba5f40
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/core/src/providers/authkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export interface AuthKitProfile extends Record<string, any> {
id: string
email: string
email_verified: boolean
first_name: string
last_name: string
profile_picture_url: string | null
first_name?: string | null
last_name?: string | null
profile_picture_url?: string | null
created_at: string
updated_at: string
}
Expand Down Expand Up @@ -71,9 +71,16 @@ export default function AuthKit<P extends AuthKitProfile>(
},
},
profile(profile) {
let name = null
if (profile.first_name) {
name = profile.first_name
}
if (profile.last_name) {
name = name ? `${name} ${profile.last_name}` : profile.last_name
}
return {
id: profile.id,
name: `${profile.first_name} ${profile.last_name}`,
name,
email: profile.email,
image: profile.profile_picture_url ?? null,
}
Expand Down

0 comments on commit 8ba5f40

Please sign in to comment.