@@ -231,6 +231,13 @@ void CompleteSetAccountInfoPromise(Promise<SignInResult>* const promise,
231
231
promise->CompleteWithResult (result);
232
232
}
233
233
234
+ void TriggerSaveUserFlow (AuthData* const auth_data) {
235
+ auto auth_impl = static_cast <AuthImpl*>(auth_data->auth_impl );
236
+ if (auth_impl != nullptr ) {
237
+ auth_impl->user_data_persist ->SaveUserData (auth_data);
238
+ }
239
+ }
240
+
234
241
template <typename ResultT>
235
242
void PerformSetAccountInfoFlow (
236
243
AuthDataHandle<ResultT, SetAccountInfoRequest>* const handle) {
@@ -240,6 +247,8 @@ void PerformSetAccountInfoFlow(
240
247
if (account_info.IsValid ()) {
241
248
User* api_user_to_return =
242
249
account_info.MergeToCurrentUser (handle->auth_data );
250
+
251
+ TriggerSaveUserFlow (handle->auth_data );
243
252
CompleteSetAccountInfoPromise (&handle->promise , api_user_to_return);
244
253
} else {
245
254
SignOutIfUserNoLongerValid (handle->auth_data ->auth , account_info.error ());
@@ -367,6 +376,8 @@ void PerformReauthFlow(AuthDataHandle<FutureResultT, RequestT>* const handle) {
367
376
if (auth_result.uid () == current_uid) {
368
377
const SignInResult sign_in_result =
369
378
auth_result.SetAsCurrentUser (handle->auth_data );
379
+
380
+ TriggerSaveUserFlow (handle->auth_data );
370
381
CompletePromise (&handle->promise , sign_in_result);
371
382
} else {
372
383
FailPromise (&handle->promise , kAuthErrorUserMismatch );
0 commit comments