Genie Discord forum

Author AvatarBouzeux
5/3/2023, 4:37:37 PM

I got a layout with a navbar (it's present in every page) and I'd like to change it depending on wether one is logged or not. But unlike views it's not very clear in which context the layout is run or how to access variables. Is there a way to do that ?

Author AvatarBouzeux
5/3/2023, 4:53:37 PM

I think I found a solution, I added an initializer with using GenieAuthentication and I can then call stuff like Main.UserApp.@authenticated!in my layout. Not sure if that's the best way to do it though.

Author Avatarabhimanyuaryan
5/7/2023, 10:36:27 AM

that appears to be the way of achieving this