Set current User in Javascript

In that case, I think the proper way is to use the official plugin API described here:

It has a function to retrieve the current user:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/plugin-api.js.es6#L40

(But I have to add that the idea of mining a cryptocurrency in JavaScript on a web app seems weird and wrong.)

8 Likes