signInWithApple method

Future<AuthUserCredentialVO> signInWithApple()

Signs in the user using Apple authentication and returns an AuthUserCredentialVO object.

Implementation

Future<AuthUserCredentialVO> signInWithApple() async {
  try {
    final authCredential = await _authDataService.signInWithApple();
    final vo = AuthUserCredentialVO.fromAuthUserCredential(authCredential);
    _authStateController.add(currentUser);
    return vo;
  } catch (e) {
    if (e is RdevException) {
      throw AuthServiceException(
        code: e.code,
        message: e.message,
        stackTrace: e.stackTrace,
      );
    }
    throw AuthServiceException(
      stackTrace: StackTrace.current,
      message: e.toString(),
    );
  }
}