# Fakebook Theme

**URL:** <https://meta.discourse.org/t/fakebook-theme/109079>\
**Category:** Theme\
**Tags:** official, fakebook-theme\
**Created:** [February 13, 2019, 8:18pm UTC](https://meta.discourse.org/t/fakebook-theme/109079 "2019-02-13T20:18:45Z")\
**Posts on this page:** 1\
**Showing post:** 63

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [August 27, 2020, 4:44pm UTC](https://meta.discourse.org/t/fakebook-theme/109079/63 "2020-08-27T16:44:39Z")

</div>

Hello,

Have a problem with fakebook and modern fakebook theme. On the right sidebar. This script should not load to logged out visitors. Is there any idea to load this script only the logged in users? Thank you 🙂

```
<!-- Custom sidebar widget -->

<script type="text/discourse-plugin" version="0.8">
  const ajax = require('discourse/lib/ajax').ajax;

  let currentUser = Discourse.User.currentProp('username');

  api.registerConnectorClass('discovery-below', 'sidebar', {
    setupComponent(args, component) {
      ajax("/u/" + currentUser + "/summary.json").then (function(result){

        stinkinBadges = [];

        userLikesReceived = result.user_summary.likes_received;
        userLikesGiven = result.user_summary.likes_given;

        result.badges.forEach(function(badges){
          stinkinBadges.push(badges);
        });

        component.set('userLikesReceived', userLikesReceived);
        component.set('userLikesGiven', userLikesGiven);
        component.set('stinkinBadges', stinkinBadges);
        component.set('userName', api.getCurrentUser().name);
        component.set('user', api.getCurrentUser().username);

      });

    }

  });
</script>

```

The error code is:

 ![Screen Shot 2020-08-27 at 3.19.36 PM](https://global.discourse-cdn.com/meta/original/3X/7/2/72bbbf6c751805e1f94de65558039ecb96380330.png)

---

_[View the full topic](https://meta.discourse.org/t/fakebook-theme/109079)._
