Hi,
Contributions around this would be great, but it's not the simplest thing to implement.
We very much do not want to update the user on every login, as this will have quite a bit of an impact on performance. We also have similar needs to detect other idle things like clients and tokens. What I had in mind here was to create a separate component that tracks last-use for a resource, and updates the last-use async.
We need a background task that can perform actions on expired resources. For users there are probably two actions: "disable after N days" and "delete after X days". We also would want admin UI/API to be able to list inactive users, as well as events triggered when a user is disabled or deleted due to inactivity.