Skip to content

Commit 21d618e

Browse files
committed
non abstract UserInfoInterface
1 parent d98edbc commit 21d618e

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

auth/integration_test/src/integration_test.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,16 +1440,19 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
14401440
WaitForCompletion(
14411441
auth_->CreateUserWithEmailAndPassword(email.c_str(), kTestPassword),
14421442
"CreateUserWithEmailAndPassword");
1443+
LogError("User creation returned\n");
14431444
EXPECT_TRUE(auth_->current_user().is_valid());
14441445
EXPECT_FALSE(auth_->current_user().is_anonymous());
14451446
firebase::auth::User user = auth_->current_user();
14461447
std::string prev_provider_id = user.provider_id();
14471448
// Save the old provider ID list so we can make sure it's the same once
14481449
// it's loaded again.
14491450
std::vector<std::string> prev_provider_data_ids;
1451+
LogError("user.provider_data().size(): %d\n", user.provider_data().size());
14501452
for (int i = 0; i < user.provider_data().size(); i++) {
14511453
prev_provider_data_ids.push_back(user.provider_data()[i].provider_id());
14521454
}
1455+
LogError("prev_provider_data_ids.size(): %d\n", prev_provider_data_ids.size());
14531456
Terminate();
14541457
ProcessEvents(2000);
14551458
Initialize();
@@ -1460,9 +1463,11 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
14601463
EXPECT_EQ(auth_->current_user().provider_id(), prev_provider_id);
14611464
user = auth_->current_user();
14621465
std::vector<std::string> loaded_provider_data_ids;
1466+
LogError("user.provider_data().size(): %d\n", user.provider_data().size());
14631467
for (int i = 0; i < user.provider_data().size(); i++) {
14641468
loaded_provider_data_ids.push_back(user.provider_data()[i].provider_id());
14651469
}
1470+
LogError("loaded_provider_data_ids.size(): %d\n", loaded_provider_data_ids.size());
14661471
EXPECT_TRUE(loaded_provider_data_ids == prev_provider_data_ids);
14671472

14681473
// Cleanup, ensure we are signed in as the user so we can delete it.

auth/src/desktop/user_desktop.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,11 +1195,16 @@ Future<SignInResult> User::ReauthenticateWithProvider_DEPRECATED(
11951195
}
11961196

11971197
std::vector<UserInfoInterface> User::provider_data() const {
1198+
printf("DEDB provider_data\n");
11981199
std::vector<UserInfoInterface> provider_data;
11991200
if (is_valid()) {
1201+
printf("DEDB is_valid\n");
12001202
std::vector<UserInfoInterface*> deprecated_provider_data =
12011203
provider_data_DEPRECATED();
1204+
printf("DEDB deprecated_provider_data size: %d\n", deprecated_provider_data.size());
1205+
provider_data.reserve(deprecated_provider_data.size());
12021206
for (size_t i = 0; i < deprecated_provider_data.size(); ++i) {
1207+
printf("DEDB copying provider_data\n");
12031208
UserInfoImpl user_info_impl;
12041209
user_info_impl.uid = deprecated_provider_data[i]->uid();
12051210
user_info_impl.email = deprecated_provider_data[i]->email();
@@ -1210,6 +1215,7 @@ std::vector<UserInfoInterface> User::provider_data() const {
12101215
provider_data[i] = UserInfoInterfaceImpl(user_info_impl);
12111216
}
12121217
}
1218+
printf("DEDB provider_data return length: %d\n", provider_data.size());
12131219
return provider_data;
12141220
}
12151221

auth/src/include/firebase/auth/user.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class UserInfoInterface {
6262
/// </csproperty>
6363
/// @endxmlonly
6464
/// </SWIG>
65-
virtual std::string uid() const = 0;
65+
virtual std::string uid() const { return std::string(); }
6666

6767
/// Gets email associated with the user, if any.
6868
/// <SWIG>
@@ -72,7 +72,7 @@ class UserInfoInterface {
7272
/// </csproperty>
7373
/// @endxmlonly
7474
/// </SWIG>
75-
virtual std::string email() const = 0;
75+
virtual std::string email() const { return std::string(); }
7676

7777
/// Gets the display name associated with the user, if any.
7878
/// <SWIG>
@@ -82,7 +82,7 @@ class UserInfoInterface {
8282
/// </csproperty>
8383
/// @endxmlonly
8484
/// </SWIG>
85-
virtual std::string display_name() const = 0;
85+
virtual std::string display_name() const { return std::string(); }
8686

8787
/// Gets the photo url associated with the user, if any.
8888
/// <SWIG>
@@ -92,7 +92,7 @@ class UserInfoInterface {
9292
/// </csproperty>
9393
/// @endxmlonly
9494
/// </SWIG>
95-
virtual std::string photo_url() const = 0;
95+
virtual std::string photo_url() const { return std::string(); }
9696

9797
/// Gets the provider ID for the user (For example, "Facebook").
9898
/// <SWIG>
@@ -102,10 +102,10 @@ class UserInfoInterface {
102102
/// </csproperty>
103103
/// @endxmlonly
104104
/// </SWIG>
105-
virtual std::string provider_id() const = 0;
105+
virtual std::string provider_id() const { return std::string(); }
106106

107107
/// Gets the phone number for the user, in E.164 format.
108-
virtual std::string phone_number() const = 0;
108+
virtual std::string phone_number() const { return std::string(); }
109109
};
110110

111111
/// @brief Additional user data returned from an identity provider.

0 commit comments

Comments
 (0)