Same problem. Anybody have a way to set this up for the entire app without a page load?
Hi there all,
Is there any latest update to solve this issue of time lagging? I have the exactly same problem.
Bubble,
I also am having this issue. The shape that hides the content for the 2-4 second delay is not ideal. This really seems like a feature you guys should add in because there are security concerns here. Just because the user canât see the info because of the shape covering it up, it is still accessible in the DOM for that 2-4 seconds.
So, Iâm not sure if I followed the topic correctly in its entirety, however, I solved the problem like so:
- Create a group that contains all content of the page
- Go to this groupâs inspector tab âappearanceâ and uncheck âthis element is visible on page loadâ
- Go to this groupâs inspector tab âconditionalâ and create conditionals that switch the group to visible if user is logged in
Any redirection can be added on top, but it seems to me that the content is not visible on page load, not even for the first few seconds, because before anything, the pageâs content is set to not visible. Then the check comes if the user is logged in, and if they are, visbility will be toggled to on AFTER the page is loaded.
just in case its useful to anyoneâŚ
Yep, there should be some way to not load the page to begin with, as someone suggested, something like a preload workflow.
The solutions of hiding things feel like a workaround.
In my case, I have permissions on pages. I can easily change the navigation accordingly, but if a user has a link to the page, I want to prevent the page from loading, even if the user is logged in.
Please consider adding a âpreload page workflowâ or something along those lines.
Issue for me too, this should be a supported feature due to all the work users have to do to get around it.
Folks, in implementing the workarounds suggested here, I noticed that the page loads for a couple of seconds before redirecting to the desired page IF Iâm running in debug mode. If Iâm not in debug mode, the redirect seems to happen instantly. Hope that helps.
Hello all. encountered the same problem. Solution. workflow above works and the page does not load for a second. The first thing to do is to exit debug mode (delete from url â?debug_mode=trueâ. And try reloading the page. Profit
Still an issue - if you have a url to an âinternal pageâ they get right in and then can use navigation to get to other pages. This seems like a pretty significant security issue.
Yes youâre missing something. This is core Bubble functionality that is quite simple to implement. If the user is not logged in, just redirect them. This is pretty much the only valid use case for the âon page loadâ event, BTW.
There is an event âUser is logged outâ just pick that and redirect the user
Itâs a condition actually, but yes correct.
Also, @anon13668301 do you even know who youâre trying to pick a fight with? I challenge you to a cage match.
Ok well yeah, @tylerboodman. But you can also do page is loaded and user is logged out, which is how I think of this. I think the net result is the same.
In my opinion, when the user is logged out > go to page authentication (or index) is faster than the on-page load and the current user is not logged in > go to page authentication (or index).
@emmanuel If we have a pre-load workflow then that would be great.
Hi All,
Still looking for a solution for this.
What I was expecting here is the following scenario: user opens two or more tabs and then when the user logout I was expecting to redirect the user in all tabs to login page (or something near to that). So the user cannot and wont perform any action on the app once the session is closed.
Iâve already tried all the do every, current you logged out and even re-usable elements with workflow on 2 different pages and tabs, but itâs not working.
Any updates on this? Thanl you very much.
Hello fellow Bubblers, I was also banging my head against this same issue. Here was my solution.
SOME CONTEXT:
- I was working on setting up basic auth pages & workflows for sign up / sign in
- I thought to make both of these calls âAPI Workflowsâ on the Backend (for obvious reasons)
- I had no issues making the âAPI Workflowâ work for Sign up but this DID NOT work for Sign In unfortunately.
MY ORIGINAL APPROACH:
- On my âsign-inâ page here is how I originally had my workflow setup for when someone clicked on the Sign In button. I thought, okay letâs move this call to the backend, NOT the frontend:
2) You can see here that API Workflow just passes the values from my email + password inputs into the backend workflow.
3) In my Backend Workflow I created one called âuser_loginâ. My thought process was to send this form data to the backend instead of on the front end, because this is how it worked for Sign Up, I assumed this would work the same for login
NOTE: You can see the details of the âuser_loginâ API Workflow here. Nothing fancy, just capturing the email + password values passed from the front end to use in the âLog the user inâ action.
Unfortunately this was not working for some reason.
MY SOLUTION:
- So instead of calling the API Workflow for âuser_loginâ and passing the data to the backend I ended up just directly calling the âLog the user inâ action from the Frontend.
To test further and make sure that the user was indeed logged in I set a page restriction for the authenticated page I send users to after they login. This how I set it up:
ENDING THOUGHTS:
- Iâve reached out to Bubble to confirm with them if this is best practices or not as this seemed a bit of a wonky approach.
- Perhaps Bubble assumes the Log the user in action is handled safely on the Backend
- Once I hear anything back from them Iâll be sure to post it here.
I hope this helps someone.
@yeahitsmejayyy
I would think that no matter where you run them (front or backend), security will be the same as sign-up and login actions are already API calls to bubble servers, so the requests will actually remain the same
And it might even degrade a bit the performance, because you would perform the same actions at the end but with the api scheduling which is itself an action
Let us know if you find a final answer from Bubble
Create a new Workflow and select âUser is logged outâ in the General tab. Direct the user to navigate to the login page.
Iâve found there is now buffer period and goes straight to the login page.
Hope this helps.
jacobherrmann115 solution of using âUser is logged outâ instead of the âpage is loadedâ event fixed my problem, thank you! Accessing a logged in page no longer loads the page before redirecting, just sends them straight to /index after a second or two.