deleteCurrentUser method

Future<void> deleteCurrentUser()

Implementation

Future<void> deleteCurrentUser() async {
  try {
    if (_auth.currentUser is User) {
      await _auth.currentUser!.delete();
    } else {
      throw AuthDataServiceException(
        message: 'No current user',
        code: RdevCode.NotFound,
      );
    }
  } catch (err) {
    if (err is AuthDataServiceException) {
      rethrow;
    }
    throw AuthDataServiceException(
      message: err.toString(),
    );
  }
}