Skip to content
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
3 changes: 3 additions & 0 deletions auth/user_mgt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions auth/user_mgt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ var testUser = &UserRecord{
ProviderID: "phone",
PhoneNumber: "+1234567890",
UID: "testuid",
}, {
ProviderID: "github",
ScreenName: "login",
UID: "testuid",
},
},
TokensValidAfterMillis: 1494364393000,
Expand Down Expand Up @@ -1926,6 +1930,10 @@ func TestMakeExportedUser(t *testing.T) {
ProviderID: "phone",
PhoneNumber: "+1234567890",
UID: "testuid",
}, {
ProviderID: "github",
ScreenName: "login",
UID: "testuid",
}},
MFAInfo: []*multiFactorInfoResponse{
{
Expand Down
5 changes: 5 additions & 0 deletions testdata/get_user.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"providerId": "phone",
"phoneNumber": "+1234567890",
"rawId": "testuid"
},
{
"providerId": "github",
"screenName": "login",
"rawId": "testuid"
}
],
"photoUrl": "http://www.example.com/testuser/photo.png",
Expand Down
10 changes: 10 additions & 0 deletions testdata/list_users.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"providerId": "phone",
"phoneNumber": "+1234567890",
"rawId": "testuid"
},
{
"providerId": "github",
"screenName": "login",
"rawId": "testuid"
}
],
"photoUrl": "http://www.example.com/testuser/photo.png",
Expand Down Expand Up @@ -66,6 +71,11 @@
"providerId": "phone",
"phoneNumber": "+1234567890",
"rawId": "testuid"
},
{
"providerId": "github",
"screenName": "login",
"rawId": "testuid"
}
],
"photoUrl": "http://www.example.com/testuser/photo.png",
Expand Down