Getting user data from UID

NodeBB Plugins

Suggested Topics

  • 0 Votes
    3 Posts

    I may commission the Nodebb team for this work. I have been in contact with @julian regarding it.

  • 0 Votes
    4 Posts

    @julian Thanks this did the trick!

    I used it like this in my client side code:

    <input id="csrfToken" type="hidden" name="_csrf" value="" /> ... $(window).on('action:ajaxify.end', function(data) { require(['csrf'], function(csrf) { var csrfToken = csrf.get(); console.log('obtained csrfToken: ' + csrfToken); $('#csrfToken').val(csrfToken); }); });

    @yariplus I'm not really sure about your specific question. I have a feeling that the csrf tokens are generated based on a csrfSecret that is stored in the user's session. You could check that the session has this loaded on the server side with this:

    var util = require('util'); console.log('user session' + util.inspect(req));

    For me, this results in:

    user session: { cookie:
    { path: '/',
    _expires: Sun Nov 22 2015 09:52:23 GMT-0800 (PST),
    originalMaxAge: 1209599988,
    httpOnly: true },
    csrfSecret: '70lFS_InV_56D1gvV9TDKgJX',
    flash: {},
    passport: { user: 1 } }

  • 0 Votes
    9 Posts

    Hey!!! Thanks for the reply.... We have completed our task.

  • 0 Votes
    1 Posts


    I was just trying to write my first Plugin but failed when referencing custom fonts in my .less.

    my fonts are in ./static/fonts and my .less is ./static/style.less

    in my .less i use eg: url(fonts/font.woff)

    The font doesnt get loaded though.

    What is the easiest way to include fonts in my Plugin?

    edit: it seems to work if i use plugins/nodebb-plugin-pluginname/static/fonts as fonturl
  • 6 Votes
    11 Posts

    @pichalite said:

    Should be fixed now. update to latest version of the plugin.

    No Update available.

    Bildschirmfoto 2015-06-01 um 11.55.28.png