Specialized plugin for BRF Energi forum, supposed to make everything run right the way we want it.
Not really API, but shows admin interface and some options. Probably pretty ugly and full of test options
Redirects to /auth/metry
if you're not logged in yet, otherwise just goes to homepage
(For /auth/metry
, see sso-metry plugin).
Performs BRF authentication, and if successful returns the userid
Wants an already-authenticated BRF token, and if it checks out it either authenticates the corresponding user or creates a new one in case it doesn't exist on the forum yet. Used for the linking between forum and main website.
Authenticates by username/email and password like normal, returns uid and metryid if exists. You can use an email as the username, it willbe resolved. In case of incorrect password, you'll get something like this:
{
"path": "/forum/api/brfauth/uid",
"error": "[[error:invalid-login-credentials]]"
}
Register a new user thru nodebb. This is a nodebb-official endpoint, but I include some docs on it here because it's useful, while risking that it becomes outdated.
Body:
token=(Token)
(Token) :=
{
"username": "JohnDoe",
"email": "[email protected]",
"password": "djd982j3dj8ffa2ca02",
"_uid": "1" // Admin, dont change.
}
Token shall be signed with the key that is set in the plugin settings.
Good response:
{"code":"ok","payload":{"uid":33}}
Bad responses:
{"code":"internal-server-error","message":"email-taken","params":{}}
{"code":"params-missing","message":"Required parameters were missing from this API call, please see the \"params\" property","params":["_uid"]}
A starter kit for quickly creating NodeBB plugins. Comes with a pre-setup LESS file, server side JS script with an action:app.load
hook, and a client-side script. Most plugins need at least one of the above, so this ought to save you some time. For a full list of hooks have a look at our wiki page, and for more information about creating plugins please visit our documentation portal.
Fork this or copy it, and using your favourite text editor find and replace all instances of nodebb-plugin-brf-energi
with nodebb-plugin-your-plugins-name
. Change the author's name in the LICENSE and package.json files.
Once you're done don't forget to publish it on NPM, and make a thread about it here.
Really simple, just edit static/lib/main.js
and paste in console.log('hello world');
, and that's it!
npm install nodebb-plugin-brf-energi
Don't forget to add screenshots!