Yeah, that would have been ideal, but I am not using Wordpress SSO. I apologize that I chose to write about my issue here not realizing from the title the first time that this topic was tagged “wordpress”.
Thank you for pointing me to the code path that I will need to modify through the plugin. But indeed, this approach seems fairly unmaintainable as Discourse evolves. I will consider it later, if necessary.