# Extending header buttons

**URL:** https://meta.discourse.org/t/extending-header-buttons/337462
**Category:** Development
**Created:** [November 21, 2024, 9:03am UTC](https://meta.discourse.org/t/extending-header-buttons/337462 "2024-11-21T09:03:24Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 9:03am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/1 "2024-11-21T09:03:24Z")

</div>

Hi - we have inherited a Discourse forum which is well established. I would like to modify the functionality of the “create account” header button.

I managed to install the Ember Chrome plug-in which I used to inspect the buttons - it revealed a path:

​/​var​/​www​/​discourse​/​app​/​assets​/​javascripts​/​discourse​/​node\_modules​/​.embroider​/​rewritten-app​/​components​/​header​/​auth-buttons.js

I’m not sure if but I think that the related js is here?

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/header/auth-buttons.gjs](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/header/auth-buttons.gjs)

I have access to the admin panel of the forum, I can drill down on ‘Components’ but I don’t see an entry for these buttons. I did see some used “test” components, I tried enabling one of these and copying the contents of auth-buttons.gjs file into the common head section but when I try to save I got errors.

So my question being - how can I extend and customise the functionality of these buttons.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [November 21, 2024, 9:09am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/2 "2024-11-21T09:09:59Z")

</div>

Hi there, what are you trying to do with these buttons?

---

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 9:35am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/3 "2024-11-21T09:35:17Z")

</div>

We want users to register via our main site - the account login then work for the forum…

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 10:22am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/4 "2024-11-21T10:22:47Z")

</div>

You really need to use SSO. Discourse will automatically adapt to your sso provider once it is configured correctly.

---

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 11:09am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/5 "2024-11-21T11:09:28Z")

</div>

We are already using SSO - the forum authenticates users via the same provider as our main site. However when a user register for an account at the forum we simply want to direct them to the main site - what is the best way of doing this?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [November 21, 2024, 11:15am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/6 "2024-11-21T11:15:02Z")

</div>

> [@LVHN](#):
>
> when a user register for an account at the forum we simply want to direct them to the main site

Are you totally sure you really want to do that? From users’ point of view someone is trying to screw them. They were interested in a forum and after registration they’ll find themselves somewhere else.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 11:25am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/7 "2024-11-21T11:25:47Z")

</div>

Disable all other methods of authentication (including local logins) only let sso remain as the option to log in. That would automatically send users to log in to your main site.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [November 21, 2024, 11:28am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/8 "2024-11-21T11:28:51Z")

</div>

If you set it up properly I believe it will redirect back after sign in?

---

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 11:43am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/9 "2024-11-21T11:43:05Z")

</div>

Authenticatin works - it is the “signup” button that we want to customise to go to the main site…

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 11:45am UTC](https://meta.discourse.org/t/extending-header-buttons/337462/10 "2024-11-21T11:45:30Z")

</div>

That’s what I suggested above.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [November 21, 2024, 12:10pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/11 "2024-11-21T12:10:03Z")

</div>

I can second. If properly set up, the out of the box login and sign up buttons will go to the main site. You do not need to mess with the default UI.

---

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 12:11pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/12 "2024-11-21T12:11:37Z")

</div>

so there should be an option somewhere in the admin where I can specify the external url for the sign-up process?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 12:13pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/13 "2024-11-21T12:13:18Z")

</div>

No, Those parameters are supplied by your SSO provider. Discourse will only show “log in” button in header and send the user to your authentication endpoint provided by SSO provider.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [November 21, 2024, 12:17pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/14 "2024-11-21T12:17:51Z")

</div>

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045):
>
> [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) is a core Discourse feature that allows you to configure “Single Sign-On (SSO)” to completely outsource all user registration and login from Discourse to another site. Offered to our [pro, business and enterprise hosting customers](https://discourse.org/pricing). information_source (Feb 2021) ‘[Discourse SSO](https://meta.discourse.org/t/13045?silent=true)’ is now ‘[DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)’. If you are running an old version of Discourse, the settings below will be named sso\_... rather than discourse\_connect\_... The Problem Many sites wishing to integrate wit…

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [November 21, 2024, 12:35pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/15 "2024-11-21T12:35:38Z")

</div>

Big if… I’ve seen similar solutions too often. Main purposes is then transfer an user permanently back to main site where selling happends. But totally nice if the purpose is similar than what i.e. Google does, where is taken short sidestep to authorize and then will come back to forum.

---

<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: [November 21, 2024, 12:37pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/16 "2024-11-21T12:37:57Z")

</div>

Hello 👋

Here is a theme component with you can add a custom Sign Up button. I’ve just updated now to work with new core changes.

> [@DiscourseConnect Signup Button](https://meta.discourse.org/t/discourseconnect-signup-button/245888):
>
> information_sourceSummary This theme component adds a custom Signup button to [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true).hammer_and_wrenchRepository [GitHub - VaperinaDEV/discourseconnect-signup-button · GitHub](https://github.com/VaperinaDEV/discourseconnect-signup-button)questionInstall Guide [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Hello wave This theme component adds a Sign Up button to the header with a custom URL. With this, you can easily redirect users directly t…

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [November 21, 2024, 1:12pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/17 "2024-11-21T13:12:56Z")

</div>

So if local logins are disabled the button would go straight to the sso auth?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 1:40pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/18 "2024-11-21T13:40:43Z")

</div>

Yes. That’s what happens if SSO is the only auth method.

---

<div class="post-metadata">

### Author: ![LVHN](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@LVHN](https://meta.discourse.org/u/LVHN)
#### Post date: [November 21, 2024, 3:31pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/19 "2024-11-21T15:31:27Z")

</div>

> [@itsbhanusharma](#):
>
> Disable all other methods of authentication (including local logins) only let sso remain as the option to log in. That would automatically send users to log in to your main site.

Right, so if SSO is only concerned with Auth how will it help here when I need “create account” to go to my main site?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 21, 2024, 3:36pm UTC](https://meta.discourse.org/t/extending-header-buttons/337462/20 "2024-11-21T15:36:57Z")

</div>

There won’t be a signup button once SSO is configured correctly. Then you can use the component that @Don linked above to add a custom create account button.

[Next page](https://meta.discourse.org/t/extending-header-buttons/337462.md?page=2)
