FORUM COMMUNITY IDEAS SHOWCASE LEARNING CENTER

Restrict access to a page if the user is not logged in


#1

How is it possible to restrict access to a page if the user is not logged in.

I know only one way "When page is loaded and current user is not logged it -> redirect to page XX"
But how is it possible to achieve without actually loading the whole page?


#2

Have you tried?.. The page doesn’t get loaded, the change happens on the server.


#3

Yes, I’ve tried. The page loads (I can see it for 2-3 sec) and then redirects. But I want it to happen without visual page load.


#4

something like: if user is logged in -> load page; if user isn’t logged in -> redirect


#5

How many actions do you have in your workflow? If it’s just a go to page action, it shouldn’t do this (try bubble.is while being logged in, for instance)


#6


#7

Is that the only action? Can you share a link


#8

You mean in the whole workflow? I’ve got about 20+ actions.


#9

You shouldn’t have any action after a go to page action. The issue checker is flagging this right?


#10

After “go to page” I’ve got no actions.


#11

Can you share a link?


#12

#13

I’m confused, the redirection is instantaneous for me


#14

When you log in -> log out (redirects to another page after log out) -> click “go back” in browser there will be 2-4 sec lag…


#15

Oh that’s a different situation, but doesn’t sound like something that happens no? What matters is that if a user hits https://bubble.is/site/domovoj/index he gets redirected to sign up


#16

Yes, maybe you are right. I am too meticulous :slight_smile:


#17

It’s good, we need users to push the limits to make Bubble better :smile: For that one though, let’s see if some users hit that situation in real life.


#18

Hi, I cannot find the event when Page is loaded and when current user isn’t logged in, how do I create it or find a tutorial to create it?


#19

You create it on your page. in Workflow Tab.


#20

Hi Nigel,

yes, I got it. The question was that I could not find the action to select. What exactly do I have to select in the workflow tab? I want to restrict access and redirect the user to the start page, for the page.

Thanks!