Get current user session

  • Hi,

    So we're planning on switching from Discourse to NodeBB (currently sorting out a new set of forums ready for release). While NodeBB has been amazing so far, we've come into struggles with using a NodeBB account externally. In Discourse you can do and get the current viewers user information. But with NodeBB we're unable to actually find a way of doing it.

    I've tried looking around the NodeBB GitHub but found nothing. I have also tried making a plugin for it, but can't get it to work that way either. So I'd love to know if there is already a way or if someone can help me out with my plugin:

    Any and all help is appreciated!

    Thank you 🙂

  • Anyone? 😞

  • Admin

    We could possibly add a /api/me page that returns some info about the current logged in user. What kind of info you need?

  • @baris Just a basic overview. Kinda like a JSON form of a users profile as if it was being viewed publicly. We do an AJAX request and get the information. Example from Discourse:

          "title":"Your friendly neighbourhood moderator",

    Thanks for your reply 🙂

  • Admin

    Alright since we already have this data when you go to /api/user/<userslug> we can just return the same info when you go to /me.

  • @baris That would be perfect!


| |