Find logged out users on backend?

I’m trying to detect anonymous users that have been logged out using the Realm API. My intention is to delete only the ones that are logged out so I don’t interrupt an anonymous logged-in user’s session.

I’ve looked at the code posted by Pavel_Duchovny here:

This code is great and has certainly pointed me in the right direction. While you can get information on users the information returned from the Realm API seems to be limited to the following:

user:  {"_id":"629ed46048f09c92aea97cec","identities":[{"id":"629ed46048f09c92aea97ceb-uijnvrfakxngzwclebdbvgvp","provider_type":"anon-user","provider_id":"60492552e8ab866391647df0"}],"type":"normal","creation_date":1654576224,"last_authentication_date":1654576237,"disabled":false}

So there is no information on whether the user is logged in or not. It seems kind of counterintuitive to handle this on the client. But if that’s the only way to do it I guess I’ll figure it out.