fetchProfile method

Future<CkAuthResult<TProfile?>> fetchProfile()

Fetches the profile from the server using the configured getProfile endpoint.

Implementation

Future<CkAuthResult<TProfile?>> fetchProfile() {
  return loadingController.wrap(CkAuthLoadingType.fetchProfile, () async {
    if (config.mockAuth) {
      return const CkAuthResult.success(data: null, statusCode: 200);
    }
    return _profileExtractor.fetchProfile(
      config.endpoints.getProfile,
      config.endpoints.getProfileMethod,
    );
  });
}