Hey everyone,
Can someone provide insight on how I can hide entire pages if a user is logged out?
Thanks in advance!
Hey everyone,
Can someone provide insight on how I can hide entire pages if a user is logged out?
Thanks in advance!
Hey there,
You can do that by using conditionals such as: āCurrent user is logged inā ā This element is visible
cheers
Placing the entire page in one hidden group, and placing a condition in the group: āwhen user is logged inā ā āthis element is visibleā.
This way the page is hidden by default, and youāre only dealing with a single element on the condition.
Both the above solutions are correct. To add to them, you can also navigate the logged-out user to a public page like your index or login page.
Okay awesome, thank you!~!
What would be the purpose of placing the page in a hidden group if the conditional would hide it by itself? Would this a a better practice method?
Itās probably my overly-careful personality My thinking is I donāt know how quickly a āconditionā checks for something, so I try to avoid any split-second flashes of loading before a condition returns as āTrue/Falseā to make it hidden again. Again, this may not be an issue but I do this just in case it isā¦
I think Iām following, thank you for your input! This sounds like it will be the best was since it will shortcut any lag time. Thank you for your expertise!
If a user has closed the session the correct way is to not allow access to that page if he is not logged into the system.
You can do this with a āPage is loadā event.
Inside the event you add a āGo To Pageā action and choose where you want to direct the user.
To the event you need to add a condition āCurrent user is logged outā.
So that it only executes the event when the user is not logged in.
This way, the user will not have access to the page.
If you put the content of the page inside an element and hide it, this is not a safe thing to do because if the person has experience reading code he can find information of the hidden group inside the HTML code or even if he would use the debugger mode inspector he could find the hidden group.
That makes complete sense, thank you!