logout method
- bool keepProfile = false
Deletes Session of the active MyUser and removes it from the list of available accounts.
Returns the path of the authentication page.
If keepProfile is true, then keeps the MyUser in the profiles.
Implementation
Future<String> logout([bool keepProfile = false]) async {
Log.debug('logout()', '$runtimeType');
if (userId != null) {
accounts.remove(userId);
if (!keepProfile) {
profiles.removeWhere((e) => e.id == userId);
}
_authRepository.removeAccount(userId!, keepProfile: keepProfile);
}
return await deleteSession(keepData: keepProfile) ?? Routes.auth;
}