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>
The snippet works great and displays it properly. Is there anything I can do without editing the core of discourse? Such as e.preventdefault?