# Preventing the JS to dynamically load the Hyperlink

**URL:** <https://meta.discourse.org/t/preventing-the-js-to-dynamically-load-the-hyperlink/110683>\
**Category:** Development\
**Tags:** unsupported-install\
**Created:** [March 5, 2019, 1:57am UTC](https://meta.discourse.org/t/preventing-the-js-to-dynamically-load-the-hyperlink/110683 "2019-03-05T01:57:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![JustinBack](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justinback/32/133266_2.png) [@JustinBack](https://meta.discourse.org/u/JustinBack)\
**Post date:** [March 5, 2019, 1:57am UTC](https://meta.discourse.org/t/preventing-the-js-to-dynamically-load-the-hyperlink/110683/1 "2019-03-05T01:57:59Z")

</div>

Hello everybody,

Currently designing a mix between SSO and GitHub auth.  
When SSO is enabled all other login methods disappear, thats why I use a widget to add a GitHub button to the navbar, however the JS likes to catch on the button and redirect me dynamically to a site that doesn’t exist!

```
<script type="text/discourse-plugin" version="0.4">
const { iconNode } = require("discourse-common/lib/icon-library");
if(!Discourse.User.current()) {
    api.decorateWidget('header-buttons:before', helper => {
        return helper.attach('link', {
            href: '/auth/github',
            rawLabel: "Login with GitHub",
            title: "Login with GitHub",
            icon: "github",
            className: "btn btn-primary btn-small login-button"
        });
    });
}
</script>

```

![](https://global.discourse-cdn.com/meta/original/3X/b/d/bdd8f0aba8c08364da9fbb88e27a5a448cd73d0b.png) The snippet works great and displays it properly. Is there anything I can do without editing the core of discourse? Such as e.preventdefault?

---

_[View the full topic](https://meta.discourse.org/t/preventing-the-js-to-dynamically-load-the-hyperlink/110683)._
