# Rendering at load

**URL:** <https://community.weweb.io/t/rendering-at-load/8058>\
**Category:** How do I?\
**Created:** [April 10, 2024, 10:43pm UTC](https://community.weweb.io/t/rendering-at-load/8058 "2024-04-10T22:43:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rayanenocode](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/rayanenocode/32/13166_2.png) [@rayanenocode](https://community.weweb.io/u/rayanenocode)\
**Post date:** [April 10, 2024, 10:43pm UTC](https://community.weweb.io/t/rendering-at-load/8058/1 "2024-04-10T22:43:15Z")

</div>

how to make sure that an element only renders if the user is not logged in, the trick is that on each page load we see it a little afterwards it leaves when it takes time to check the condition

i tried js, formula but not working

the javascript defines false as the default value and then checks whether the user is logged in or not. But even with this, the trick still appears a little at first

---

<div class="post-metadata">

**Author:** ![thomlov](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/thomlov/32/8591_2.png) [@thomlov](https://community.weweb.io/u/thomlov)\
**Post date:** [April 11, 2024, 6:53pm UTC](https://community.weweb.io/t/rendering-at-load/8058/2 "2024-04-11T18:53:46Z")

</div>

So is the variable explicitly set to false before the authentication is checked?  
if not, you could probably use this, should return true only if it is explicitly set to false, not undefined.

```auto
let auth = variables['72025230-2be8-41bc-9af3-7bfeaccd6a9b']?.['isAuthenticated'];

// Return true only if auth is explicitly false
return auth === false;

```

If the variable is defined as false before true always, then we should ask for a similar variable to collections “isFetching”. But to get around it you could use a time delay, and make the message transition in a little later, after you are sure the auth server have/should have replied.

---

<div class="post-metadata">

**Author:** ![rayanenocode](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/rayanenocode/32/13166_2.png) [@rayanenocode](https://community.weweb.io/u/rayanenocode)\
**Post date:** [April 11, 2024, 7:18pm UTC](https://community.weweb.io/t/rendering-at-load/8058/3 "2024-04-11T19:18:15Z")

</div>

thank you! gonna test this

---

<div class="post-metadata">

**Author:** ![rayanenocode](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/rayanenocode/32/13166_2.png) [@rayanenocode](https://community.weweb.io/u/rayanenocode)\
**Post date:** [April 12, 2024, 3:50am UTC](https://community.weweb.io/t/rendering-at-load/8058/4 "2024-04-12T03:50:48Z")

</div>

Unfortunately, it doesn’t work, it still displays during the fetching of the user. I created a ticket with weweb to get the xano auth variable so that the element is displayed only if the user is not logged in but ALSO if the user is fetching 🙂

![Capture d’écran 2024-04-12 à 03.49.33](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/42da4bbec9fb30fb822338211a36fb0606aeead4.png)
