How to not log out a user if they're offline

I’m making a PWA and want to not log users out when they go offline as they won’t be able to login again due to the security enforcer being based on a database. Is there a way to do this? Thanks.

Add a logout action to a schedule timer.
On mouse movement add a reset the action timer.
That way if there is no mouse activity for x amount of time it will automatically log them out.

Thanks @gunnery - I already have that working. The problem is that runs when a user is offline, which sends them to the login page and then they can’t log back in. I want if the user is offline for the logout to not run.

have you tried storing the username and password in a session or cookie? My only concern would be if someone else had access to the device and were able to login.

That’s a good thought - but I still need to check to see if a user is online or not I think. So if the user is online go to the server connect login page, but if they’re not go to the session login page?

You can use the browser component to detect if the user is offline or not :slight_smile:

1 Like

Perfect! Thanks @Teodor