Get UID



  • I'm trying to modify the shoutbox plugin a bit, so I can style own shouts differently. Therefore, I need the current users UID, so I can do something like

    if  (shout.fromuid === app.uid) {
      // add custom class in template
    }
    
    

    Now I tried different variables which I saw at other points in the code (app.uid) or work in the developer console (app.user.uid) But they are both undefined.

    Any hints on how to get the UID?

    Disclaimer: I'm a noob with JS. But I learn, so bare with me 😄


  • Admin

    Client side app.user.uid should be defined. Where are you trying to call it?



  • Inside of the client script... Anyway, I just restarted NodeBB and tried it again, it works fine now 🙂 Thank you!


Log in to reply
 

Suggested Topics

  • 4
  • 8
  • 6
  • 2
  • 6
| |