Forum Documentation Showcase Pricing Learn more

Prevent page loading after logout


#1

Hi Bubble community,

I have set up a workflow for users to login as follows: ‘When Page is loaded and Current User isn’t logged in’ >> ‘Show login popup’. I have also set up a logout workflow on the same page as follows: ‘When Button logout is clicked’ >> ‘Log the user out’ >> ‘Go to page index’. Unfortunately, after the Current User is logged out, the page seems to be reloading, which appears to be triggering the login workflow before the ‘Go to page index’ can be executed and as a result the login popup appears and the logged out user is not redirected to page index.

I can get around this problem by building a separate page for the login but I am wondering if I am missing something obvious. Any insights or suggestions?

Thanks,
Andy


#2

i have an idea of a couple of ways you could do it,

you could have a field for type user, is logging out? and have that set to yes before going to page and have condition when page is loaded and current users logging out is yes log the user out, set logging out back to no. This works if the page needs to refresh for whatever reason.

if page doesnt refresh you could do the same thing with states,

or the easiest way is to send parameters if you dont mind having something in url


#3

@max79268 It’s much easier (and clean) to log out the user in the same page instead of creating url things, and additional steps that really he doesn’t needs.

@andy6 Just on log out button - > Add log out workflow.
Create in the same page a separated workflow condition that runs only when current user isn’t logged in - > Do the action you want (like navigate to index page).


#4

That doesnt achieve what was asked…


#5

It’s the correct way to send user to another page after log out.

We are not only allowed to give the answer that OP wants but also recommended the best situable way to do what he pretends to.


#6

muted. i wish this forum had a block feature.


#7

You got banned one time for your friendly attitude, hope the next one comes soon. :wink:

Sorry @andy6 for moving out from the thread.


#9

Thanks @max79268 and @yusaney1,

From your comments, I was able to figure out a solution. It seems that when the user navigates away from the pages to which their login gives them access, they are automatically logged out.

@andy6