Two small questions about logged in and logged out users

  1. The main page of my app (dashboard) redirects to the index page if the user is not logged in (as Canvas suggests) but the dashboard is visible for a second before the redirects happens. How can I prevent it from showing to logged out users?

  2. What is the best way to log a user out after being inactive for X minutes?

Thanks!

Hello @baum.mori_airdev welcome to the forum!

  1. You could set the elements to be invisible by default. And only show them to logged users via setting this as a condition on each container element of the page.
  2. Build some logic that if empty after an amount of time will log the user out. Example: if you are monitoring if clicking takes place … set up a number state that on every click on your page adds a number. Then monitor that number to be X (you could use the event “do every 5 seconds”) and if so … don’t do anything … or proceed to log the user out. You will have to define what being active on the page means … and then build logic to monitor it accordingly.

image