logout method

Future logout({
  1. MSALSignoutParameters? signoutParameters,
  2. MSALAccount? account,
})

Implementation

Future logout(
    {MSALSignoutParameters? signoutParameters, MSALAccount? account}) async {
  try {
    if (account != null || _currentAccount != null) {
      await _pca.logout(signoutParameters ?? _defaultSignoutParameters,
          account ?? _currentAccount!);
      await loadAccounts();
    } else {
      throw Exception("No account to sign out");
    }
  } finally {
    _updateStatus(AuthenticationStatus.unauthenticated);
  }
}