The identity of the current user is now available in javascript
Last modified by Vincent Massol on 2021/04/06
JavaScript developers can now get the reference of the current user thanks to the xwiki-meta module that you can use like this:
require(['xwiki-meta'], function (xm) {
console.log('Hello: ' + XWiki.Model.serialize(xm.userReference));
// Will display "Hello xwiki:XWiki.Admin" in the console
});
console.log('Hello: ' + XWiki.Model.serialize(xm.userReference));
// Will display "Hello xwiki:XWiki.Admin" in the console
});