How to get username on a static page?
-
https://github.com/psychobunny/nodebb-plugin-static-page
I used this example to make a page and wanted to display the username on the page. How do I do that?
-
You wanted the current user's name? If you're using javascript try
app.username
. If you wanted to pass that in from the server side, usereq.user.uid
to call user.getUserFields to pull the username (check out src/routes/user.js line 323-341 for an example)what are you building?
-
I had a slight typo. I had req.user.id
Copyright © 2024 NodeBB | Contributors