From 04e5c50d1cae44a67956fa66c5b81e9d705419cd Mon Sep 17 00:00:00 2001 From: Bernhard Muller Date: Wed, 4 Oct 2017 09:05:33 +0200 Subject: [PATCH] Updated provider data to include phone number and federatedId --- auth_api_request.go | 5 ++++- auth_user.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/auth_api_request.go b/auth_api_request.go index 55879c5..3b8b083 100644 --- a/auth_api_request.go +++ b/auth_api_request.go @@ -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"` @@ -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"` } @@ -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, @@ -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 diff --git a/auth_user.go b/auth_user.go index a953233..44f2b60 100644 --- a/auth_user.go +++ b/auth_user.go @@ -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.