removeAccount method
- UserId id
Deletes the MyUser identified by the provided id
from the accounts and
invalidates their Session.
Implementation
Future<void> removeAccount(UserId id) async {
Log.debug('removeAccount($id)', '$runtimeType');
_authRepository.removeAccount(id);
// Delete [Session] for this account if it's not the current one.
final AccessTokenSecret? token = accounts[id]?.value.access.secret;
if (id != userId && token != null) {
await _authRepository.deleteSession(accessToken: token);
}
}