I have been able to setup a account creation form all works well and takes the user to a page which displays their details.
I have added a Logout button and seems to work, but the user data on the page does not refresh no matter what I try.
So the user data should disappear if the user is logged out. It works if I manually refresh the page.
I have tried a click event to reload the user data Action, but that does not work the user data is still shown.
I am sure I am doing something wrong but I am unable to reload the page data and from reading you can do this without reloading the whole page?
I have been following the webinar here: https://youtu.be/1NLr9eHowaI Webinar 3 Part 1 - Login, Logout, security provider
It also seems in the webinar it didn’t work either using a click event.
Can anyone share with me the correct way to refresh page data when a user logs in or out of the same page?
So you don’t want to redirect users back from this page, after they are logged out? And it is not protected to auto-redirect if not logged users try to access it?
In this case you can use conditional regions.
As a condition check the user identity, if it returns a value the conditional region content will be displayed - if not, it won’t be rendered.
Thanks @max_gb that worked! I couldn’t get it to work at the button level on click event for some reason but when attached to the form on ‘success’ worked as expected.
It’s supposed to be run onsuccess.
Events attached to the same button on click don’t wait for each other to complete. In order to be sure something happens after another, you need to run it exactly using the dynamic events - on done / on success.