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?


  • 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.

Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.