signInWithGoogle method

Future<CkAuthResult<TProfile>> signInWithGoogle(
  1. CkGoogleAuthData data
)

Authenticate with Google

Implementation

Future<CkAuthResult<TProfile>> signInWithGoogle(CkGoogleAuthData 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 Google sign in successful'},
      );
    }
    return socialManager.authenticateGoogle(data);
  });
}