How to programmatucally check in JavaScript whether the current Discourse user is authenticated?

See also: