[Solved] How to check if user is logged in? (Workflow)

Hi folks,

I am trying to understand the workflow for this scenario.

I have a button that displays a pop up. When a user clicks on the button, I want to show the ‘login box’, if he/she is not logged in.

I mean I want to make sure the user is logged in before he can access the content of the pop up.

I am trying to understand the workflow for the above, but not making progress. Would appreciate any pointers.

Many thanks in advance folks.

Cheers

newbie

1 Like

Create two workflows:

  1. condition: When the user is logged in… do X

  2. condition: When the user isn’t logged in - element action, show, popup.

1 Like

So they get one set of contents if they are logged in, and another if not ?

In that case you could put a couple of groups in the popup, and have conditions that show one or the other depending on the “user is logged in” function.

1 Like

Many thanks folks. It works. Awesome stuff

Cheers

How do you setup the “when the user is logged in” part? I am only able to try Log the user in.

3 Likes

Thanks csblack, sometimes it’s hard to find tucked in features when you’re stressed.

1 Like

Anyone know how to show active users that are logged in?

Im thinking of google spreadsheets where on the top row, it shows who is viewing the same sheet as you. I noticed that we never log out of google, but only when we are both logged in and are viewing the sheet in a browser would we be shown in that area on google spreadsheets.

Ive created a list of users that are on my app with a small green circle beside it. I have set a condition on the circle to be visible if the user is logged in (similar to say skype or a messenger app will show who is around). The trouble is, that our users never log out, they just close and open a browser each day. Thus the green circle is always showing for all users.

I don’t necessarily want us all to have to login every day, but is there an additional level of logic to see if someone has the app open in a browser or is viewing the app somehow?

Thanks,

1 Like

This isn’t a great solution (so hopefully someone else has a better one) but its better than showing a green dot. when a user isn’t using your app.

You could create a date field on the user in the database “last_updated”. Run a workflow every time your main page(s) is loaded, which updates the date in the db. Then show the green dot based on whether “last_updated” is less than 15 mins from current time. Then change it to yellow if it was within the hour…etc.

Admittedly terrible, but better than nothing.

2 Likes

Maybe if you could integrate intercom.io you will be able to know when users are logged in.

It´s one of my concerns also because what happens if you are releasing a new version of the app? You need to check that users are not logged in so you can make the modifications.

Thanks.

Set up Google Analytics and checking the live status may be work-around solution.

1 Like

How I did this for navigation and forcing a user to log out if they aren’t logged in:

1. Created a navigation bar that is only shown to logged in users

2. Made this navigation bar group and then turned it into a reusable component (right click you will find it)

image

3. Navigate to the workflow for the reusable component

image

4. Add a Workflow for when users is logged out… go back to the login page

image

image

1 Like