Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/additional provider data #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion auth_api_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ type getAccountInfoResponse struct {
type accountInfo struct {
LocalID string `json:"localId"`
Email string `json:"email"`
PhoneNumber string `json:"phoneNumber"`
EmailVerified bool `json:"emailVerified"`
PhoneNumber string `json:"phoneNumber"`
DisplayName string `json:"displayName"`
PhotoURL string `json:"photoUrl"`
Disabled bool `json:"disabled"`
Expand All @@ -146,6 +146,7 @@ type providerInfo struct {
ProviderID string `json:"providerId"`
DisplayName string `json:"displayName"`
Email string `json:"email"`
PhoneNumber string `json:"phoneNumber"`
PhotoURL string `json:"photoUrl"`
}

Expand Down Expand Up @@ -201,6 +202,7 @@ func newUserRecord(info *accountInfo) (*UserRecord, error) {
for idx, val := range info.ProviderUserInfo {
user.ProviderData[idx] = &UserInfo{
UID: val.RawID,
FederatedID: val.FederatedID,
DisplayName: val.DisplayName,
PhoneNumber: info.PhoneNumber,
Email: val.Email,
Expand Down Expand Up @@ -396,6 +398,7 @@ func (h *requestHandler) call(api *apiSettings, src, dst interface{}) error {
if err = loadHTTPResponse(resp, dst); err != nil {
return err
}
fmt.Println("Response: ", dst)
if api.respFn != nil {
if err = api.respFn(dst); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions auth_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type UserInfo struct {
PhoneNumber string
Email string
PhotoURL string
FederatedID string
}

// UserMetadata defines the data model for Firebase interface representing a user's metadata.
Expand Down