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

javascript
authentication
current-user
user

(Dmitry Fedyuk) #1

You can do it by comparing the Discourse.User.current() expression with null.

An example:

Another example (2018-03-28)


How to programmatucally check in a Rails controller whether the current Discourse user is authenticated?
How to show the «Log In» popup programmatically?
(Dmitry Fedyuk) #2

See also:


(Dmitry Fedyuk) #3

How to show the «Log In» popup programmatically?