signOut method

Future<void> signOut()

Sign out the current user.

Implementation

Future<void> signOut() async {
  if (currentUser == null || !currentUser!.isAuthenticated) {
    throw CarpServiceException(message: 'No user is authenticated.');
  }

  _currentUser!.signOut();
  _currentUser = null;
  _authEventController.add(AuthEvent.unauthenticated);
}