initializeState method

  1. @override
IAuthState initializeState(
  1. AuthUserProfile? profile,
  2. Stream<ErrorStack> appErrors
)
override

Implementation

@override
IAuthState initializeState(
    AuthUserProfile? profile, Stream<ErrorStack> appErrors) {
  if (state == null) {
    state = FirebaseAuthState(this, profile?.fbUser, profile?.profile,
        appErrors: appErrors);
  } else if (profile?.fbUser != null &&
      profile!.fbUser!.isAnonymous != true) {
    log.warning("Re-initializing auth state with profile $profile");
    state!.initializeState(
      fbUser: profile.fbUser,
      profile: profile,
      resetState: true,
    );
  } else {
    log.warning("No user to initialize with");
  }

  return state!;
}