Log Out Inactive user (server side)

Hi Bubblers,

I’m looking for a way to log out all the inactive users even if they have closed the app/browser.

I already record the “last activity” date for each and I can log them out client side, but I also want to log them out if they have quit the app, or closed the browser.

Thanks for your help ! :folded_hands:

I found a post about how to do it manually.

You could combine it with this strategy to allow automation, but users’ passwords need to be reset so it might not work for you.

Aside from this I know no other way to logout other users in an automated way, sadly.

You can check out this plugin which detects user inactivity after a pre-specified time:

You can always define a User’s field status and work with it, rather than with the login /logout state of the user.

Is there any particular reason why you want the users effectively logged out?

Thank you. But it’s a client side solution.
I think it’s not possible to do it server side.

Yep thank you. But it’s also a client side solution. That needs the user to still have the app/page open.

It was to stop any WF (refresh token, activity log, etc..) easily.
But because it’s impossible , Iwill use the inactivity date to stop them all.

It’s not a client-side solution. It’s server-side.

It’s a superadmin resetting the user password and using it to invoke an Auth API workflow, with the user email and the newly reset password, to receive a user token and invoke another API workflow that uses the Log the user out action.

The only downside is that the user’s password is reset and if he comes back he would need to reset the password to be able to log in. Not very user-friendly.

Since this is the final goal, there are indeed other ways to achieve it, not involving an automated bulk logout process.

Instead of logging them out, why not set an inactive boolean on the user and log them out on their next visit?

I don’t see the need to do anything else, other than spending more time solving a problem that isn’t really a problem. I could be wrong, and you might have a different argument.

For backend workflows, set a condition only if the user is active and cancel otherwise.

Yes I applied a new strategy. But I wanted to know if it was possible.

If a user schedules an API workflow and the workflow has the “Log user out” action it will server-side log them out

So you can setup some perpetual thing where on page load (only when user’s API ID is empty) schedules API workflow 24 hours later (store the resulting API ID on the user) → log out user only when their “last activity” date is less than current date/time. Otherwise schedule the workflow again 24 hours later.