Error in nodebb-plugin-session-sharing {"name":"JsonWebTokenError","message":"jwt malformed"}

General Discussion

Suggested Topics

  • 0 Votes
    7 Posts

    By the way, this annoys me too, how can I turn it off?

  • Add to NodeBB sections

    General Discussion
    0 Votes
    11 Posts
  • 1 Votes
    11 Posts

    Depends what you want to do... if you want to be notified when user data is updated, then the action hook is fine (if you're not changing anything in the data payload itself).

    Useful if you want to take the new user data and update another set of data somewhere else 🤔

  • 0 Votes
    2 Posts

    So I ended up answering my own question:

    If you would like to tap into your db object from within a plugin and use mongoDB's native functions, 'db.client' will provide them.


    var db = module.parent.require('./database'); function getResult(req, res, next, callback){ var data = db.client.collection('objects').find({cid: "1"}).toArray()//Query whatever .then(function(data) {//Pass the promise through a callback console.log(data.length); // Use this to debug callback(req, res, data, next)//Send data to your render function or where ever }) }

    Hope this saves someone else some time if they're trying to achieve the same thing!

  • 2 Votes
    2 Posts

    @psychobunny Actually I had an idea, but forgot to share it.
    Would be great to have screenshots section in plugin.json.

    This upgrade will give opportunity to beautify Plugins section in NodeBB, also it will educate 3rd-party developers to at least reuse screens in README 😉