How to restrict a page only to logged in user and then redirect back

I want a page to be accessible only when a user is logged in and redirect back to that page once the user logs in. How can I do that?


Try this out, for the page(s) you want to restrict access to, you can do the following in the workflow:

  1. In the “page load” event, you can choose “Go to page” action under the “navigation” group.
  2. In the workflow step1, specify the “Destination” page as your “Login” page and make the condition as “Current User isn’t logged in”.

Alternatively, if you have a reusable header component used across all the pages that you want to restrict to, then you can do the above in the “page load” event of the reusable header components page.

Hope this helps.

Hi Kamal,

I want to redirect the user back to the original page after logging
Page X > (user not logged in) redirect to login page > Redirect back to Page X if user logs in

Hi Dipti,

Understood. That’s possible I think.

  1. When you are redirecting to the login page, send a URL parameter to identify that it is a redirect.
  2. In the login page workflow, upon successful login, redirect the user to the previous page using “go to previous page” action.

Not sure whether there are better ways to do this, but this would work i believe. Try it out if this helps.

Instead of “Page Load” event, try out the “User is logged out” event as described in the thread below. That’s a better solution for the first part of sending to login page.

Restricting App to Logged in users only - Need help - Bubble Forum

Hi Kamal

I couldn’t get it. Would you be able to share a screen share?