Embed variables in footer

Hi, I’d like to embed the SSO external_id in some custom Javascript I’m pasting into my theme footer (using the ‘Custom HTML/CSS’ button)… is there a way to access the external_id from that template? i.e. something sorta like:

   var id = {{ sso.external_id }};

If I can’t embed external_id, I would love to be able to embed the username and email.

you could map sso field to custom user field and use it like this

const user = api.getCurrentUser()

How to map sso field to custom user field, check here: Official Single-Sign-On for Discourse (sso)

You need to make that custom field public in the settings in order to access it in the theme.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.