Allowing only the logged in users to browse a link in a custom plugin



  • I have a link in my custom plugin which when clicked checks whether the user is logged in or not. If yes, the system displays the appropriate HTML content.

    If not, it displays the message: "You don't seem to be logged in"

    When the user logs in, he is taken to the Register/Login screen after successful login, the system displays the HTML content.

    How can I implement this? Could anybody pl. write the code outline for this?

    Thanks



  • Is there any existing plugin that implements this feature?


  • Community Rep

    @cool You can just check req.uid, if it is true then the user is logged in.


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.