diff --git a/auth/user_mgt.go b/auth/user_mgt.go index 601c1e03..a5ea5787 100644 --- a/auth/user_mgt.go +++ b/auth/user_mgt.go @@ -59,6 +59,9 @@ type UserInfo struct { // In UserRecord.UserInfo it will return the constant string "firebase". ProviderID string `json:"providerId,omitempty"` UID string `json:"rawId,omitempty"` + // ScreenName is the user's screen name at Twitter or login name at GitHub. + // Only populated in ProviderUserInfo[] + ScreenName string `json:"screenName,omitempty"` } // multiFactorInfoResponse describes the `mfaInfo` of the user record API response diff --git a/auth/user_mgt_test.go b/auth/user_mgt_test.go index ffa48655..71266e9d 100644 --- a/auth/user_mgt_test.go +++ b/auth/user_mgt_test.go @@ -57,6 +57,10 @@ var testUser = &UserRecord{ ProviderID: "phone", PhoneNumber: "+1234567890", UID: "testuid", + }, { + ProviderID: "github", + ScreenName: "login", + UID: "testuid", }, }, TokensValidAfterMillis: 1494364393000, @@ -1926,6 +1930,10 @@ func TestMakeExportedUser(t *testing.T) { ProviderID: "phone", PhoneNumber: "+1234567890", UID: "testuid", + }, { + ProviderID: "github", + ScreenName: "login", + UID: "testuid", }}, MFAInfo: []*multiFactorInfoResponse{ { diff --git a/testdata/get_user.json b/testdata/get_user.json index 0bf86f95..84837fe8 100644 --- a/testdata/get_user.json +++ b/testdata/get_user.json @@ -20,6 +20,11 @@ "providerId": "phone", "phoneNumber": "+1234567890", "rawId": "testuid" + }, + { + "providerId": "github", + "screenName": "login", + "rawId": "testuid" } ], "photoUrl": "http://www.example.com/testuser/photo.png", diff --git a/testdata/list_users.json b/testdata/list_users.json index 2b630686..77742ba5 100644 --- a/testdata/list_users.json +++ b/testdata/list_users.json @@ -20,6 +20,11 @@ "providerId": "phone", "phoneNumber": "+1234567890", "rawId": "testuid" + }, + { + "providerId": "github", + "screenName": "login", + "rawId": "testuid" } ], "photoUrl": "http://www.example.com/testuser/photo.png", @@ -66,6 +71,11 @@ "providerId": "phone", "phoneNumber": "+1234567890", "rawId": "testuid" + }, + { + "providerId": "github", + "screenName": "login", + "rawId": "testuid" } ], "photoUrl": "http://www.example.com/testuser/photo.png",