signInWithApple method

Future<CkAuthResult<TProfile>> signInWithApple(
  1. CkAppleAuthData data
)

Authenticate with Apple

Implementation

Future<CkAuthResult<TProfile>> signInWithApple(CkAppleAuthData data) {
  return loadingController.wrap(CkAuthLoadingType.socialLogin, () async {
    if (config.mockAuth) {
      await tokenManager.saveTokens(
        accessToken: 'mock_access_token',
        refreshToken: 'mock_refresh_token',
      );
      authState.setAuthenticated();
      await CkAuthStorageKeys.markNotFirstTimeUser();
      autoNavigate();
      return const CkAuthResult.success(
        statusCode: 200,
        rawResponse: {'message': 'Mock Apple sign in successful'},
      );
    }
    return socialManager.authenticateApple(data);
  });
}