Sign out a User and Hide Pages

I have a workflow that Signs Out the user and sends them to Index. I

In a reusable header, I have a workflow that if the user is Logged Out, the navigation sends them back to Index.

Within the header, I have navigation links and if the User is Logged IN, they can navigate to a page. If the users is Logged Out, the get redirected to index.

Every single page in the app is still visible, even after signing out.

There is a conditional that only shows “Sign Out” when the user is logged in. You can press “Sign Out” be redirected, but the user is not signed out because if I had the page to the url, they are still in the application.

This should be EASY. Page Visible as a conditional element on the page. But it’s not.

Clearly I have the workflows wrong.

Hey :wave: @chris.e.daly

I normally group everything on the page into a group and then just hide it by default. Then when they are logged in, then show the group based on a condition.

Would that work for what you are looking for?

Hope that helps. :blush:

1 Like

I can do that - but makes me wonder why Bubble would ever have any page exposed to the public in an app. Kind of also negates the idea that “Sign Out” actually signs you out. Thanks for the tip!

Are you saying that you assumed that your app’s pages would only be visible to Users who were logged in?..

In which case that answer, thankfully, is definitely not. (if you think about it for more than a second, it actually wouldn’t make any sense if that were the case).

If you want that to be the case you need to build your own logic to manage it.

Why would you build an app that is available to the public without logging in?

There are a lot of people that want an app where you don’t need someone to log in. It just depends on your app’s purpose. :blush:

I created a game and I don’t want anyone to have to log in. Just add their username.

1 Like

E-commerce, accommodation booking, event booking, video streaming, to name a few, but any public pages of any other type of app as well.

And besides, if you had to be logged in to access the app, how could you log in (if you couldn’t access the login page without being logged in)?

1 Like

The login page is the entry point that is exposed. The other pages would not. Imagine going to HubSpot and the first page you land on is the Contacts page. And every user would end up INSIDE the app without ever authenticating.

There’s no such thing as a login page in Bubble - unless you happen to build one - and many apps don’t have or need one.

Yeah - I am pretty sure Bubble is not going to work for the automation platform we are trying to build. You enter a url to a page and we cannot stop you from getting there.

Yeah, it sounds to me as though you’re looking for more of a turnkey solution with a lot of functionality pre-built for you, rather than a fully open-ended platform like Bubble where you have to build everything yourself.

Although there are plenty of ways to restrict access to pages based on user roles (or other user attributes) - which is a fairly standard thing to have to manage, regardless of the platform you decide to use.

No. I have spent 9 months trying to figure out how to keep people off the pages. The issue is a known issue for Bubble going back to 2021 and has yet to be addressed. There is no workflow triggered when you go straight to the page from a url. So any workflows or conditions are ignored and you are inside the app behind the login. We have connected two shopping cart API’s into the application that retrieve orders, customers, products and carts. But not being able to close the app is a potential security issue.

What exactly is the issue you’re having with this? It’s simple to do this in Bubble, so I’m confused as to where your problem lies regarding this?

The ideal here is to achieve a server driven redirect. I had assumed it was impossible and that we were stuck with client side handling per the above examples, but this thread is interesting.

I had a quick play around when I first read this and didn’t get the same results but I didn’t give it full attention.

1 Like

If you take a url path and type it into a browser, you get straight to that page. May or may not have data. Incognito windows, browsers that have not accessed the app before. I believe it’s because the direct url bypass the On Page Load event in the workflows.

I am checking this out this morning …

If you take a url path and type it into a browser, you get straight to that page.

I have no idea what you’re talking about, but you’re obviously doing something wrong if that’s the case.

I believe it’s because the direct url bypass the On Page Load event in the workflows.

No, it doesn’t.

Thanks - your feedback is not constructive. I’ll find someone who can help…