How to programmatucally check in a Rails controller whether the current Discourse user is authenticated?

How to show the «Log In» popup programmatically?