I am guessing on all of this, never done it before
It sounds as if you want to override the local login strategy rather than provide an SSO service.
To do this you need to provide a local login strategy to passportjs during that hook, just as the core does here:
Instead of controllers.authentication.localLogin, use your own callback function. It is passed (req, username, password, next) just as it is here.
You would essentially the same thing that function does, but instead of using the local user info, use your own database to compare the username/passwords too.
If the login is successful, you need to create a local user and attach an ID from your database entry to the user's local database entry, so you can look that up when the user logs in again.
Also in the admin panel, change the registration type to none, so that users are required to have an account at your existing db.
@julian said in How to start working with Benchpress?:
Please write how to use the template rendering engine NodeBB with Benchpress
Very much I ask the brief instruction.
I want to look at topic.tpl and category.tpl from the topic nodebb-theme-rocket-master or any other topic
kill -s USR1 $(fgrep -f "app.js")
or even shorter with pkill
pkill -USR1 -f "app.js"
Substitute -USR1 with -SIGHUP and you got yourself a quick and easy build-tool command to restart NodeBB, when changing files.
(I'm using SublimeText / Atom)
I correctly assumed (and this has been validated through actual plugin upgrades) that the latest hash in npm points to the most recently published version, and not the highest version.
That is, given your plugin nodebb-plugin-example
If v1.0.0 is compatible with v0.5.4
If v1.1.0 is compatible only with v0.6.0
The latter is published first
A user typing npm install nodebb-plugin-example will receive v1.0.0 of the plugin, irrespective of what NodeBB version he/she is running, even though v1.1.0 is technically newer
Now, special note: The NodeBB Package Manager doesn't do this. When the ACP calls nbbpm to request a suggested package, we query npm for the plugin data, and sort the versions before checking compatibility, so this issue is moot.