Extending header buttons

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?

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.

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

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

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

4 Likes

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?

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.

1 Like

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.

3 Likes

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

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