Opening the login form with onclick in a theme component

Discourse’s customization code has changed a lot since 2018/2019. These resources might be very outdated.

Did you try having a look at how Discourse currently adds elements/buttons and attaches actions on them?