signOutUser method

Future<void> signOutUser({
  1. int? userId,
})

Signs out a user from the server and deletes all authentication keys. This means that the user will be signed out from all connected devices.

Implementation

Future<void> signOutUser({int? userId}) async {
  userId ??= await authenticatedUserId;
  if (userId == null) return;

  await _session.dbNext
      .deleteWhere<AuthKey>(where: AuthKey.t.userId.equals(userId));
  _session._authenticatedUser = null;
}