Skip to content

Commit

Permalink
feat: Add gender, phone, birthdate metadata by kakao provider
Browse files Browse the repository at this point in the history
  • Loading branch information
doong-jo committed Mar 2, 2024
1 parent e9f38e7 commit f5ac224
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/api/provider/kakao.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type kakaoUser struct {
ProfileImageURL string `json:"profile_image_url"`
} `json:"profile"`
Email string `json:"email"`
Gender string `json:"gender"`
Phone string `json:"phone_number"`
Birthdate string `json:"birthday"`
EmailValid bool `json:"is_email_valid"`
EmailVerified bool `json:"is_email_verified"`
} `json:"kakao_account"`
Expand Down Expand Up @@ -68,6 +71,20 @@ func (p kakaoProvider) GetUserData(ctx context.Context, tok *oauth2.Token) (*Use
ProviderId: strconv.Itoa(u.ID),
UserNameKey: u.Account.Profile.Name,
}

if u.Account.Gender != "" {
data.Metadata.Gender = u.Account.Gender
}

if u.Account.Phone != "" {
data.Metadata.Phone = u.Account.Phone
data.Metadata.PhoneVerified = true
}

if u.Account.Birthdate != "" {
data.Metadata.Birthdate = u.Account.Birthdate
}

return data, nil
}

Expand Down

0 comments on commit f5ac224

Please sign in to comment.