Best approach to add NodeBB to MEAN stack
I just want our users to sign up to either & use the same username & password or Twitter Handle etc & only have to sign up once.
Shard last edited by Shard
@tango In the case of NodeBB you should be able to do this by use of this module.
Alternately, use/ the oath module against the source fo your choice.
Shard last edited by
@tango Not a problem. I've been in this same path for a few days so I was just a smidge ahead of you on the research.
@tango there's another option: session sharing. There's a plugin for that, too. Just Google it
@Shard if I'm not mistaken the session sharing plugin allows you to create users in YOUR application and then share them into nodebb. I'm not sure about the OP but I'm working on the reverse solution. Given the great user management/profile system in nodebb, I want to leverage that and then just share that user into my application.
There's a jwt plugin that should expose a jwt which can then be used in a non-nodebb app. Unfortunately it isn't in acp and it looks like it isn't up to date. It doesn't show up after being activated and the dev log reports that the plugin may not work with the current version of nodebb.
I'm going to spend a little time trying to get it updated. I think there's a lot of value in this because of how robust the entire user system is in nodebb.
So it turns out that the JWT plugin works, it's just missing a dependency. The package.conf needs nconf installed. Once it's there the plugin starts up as expected.
From there it's very simple. Just browse to yourforum.com/api/jwt and you'll get the token if you're logged in, or you'll be redirected to the login page if you're not. Write a bit of code in your site to consume this from an ajax call and save it locally for some period of time. I suppose you could get it on each load but that seems wasteful. Cache it in local storage and the user is now logged in on your site as well.
@damian that plugin probably needs the config that NodeBB uses which means it needs to require the same nconf. That's why it's not in the package.json
It should just automatically work with NodeBB's nconf package unless you're npm linking it
@PitaJ Well that explains it. I'm npm linking it
The plugin doesn't appear to be available in ACP and the version in NPM looks out of date. Forgive my newbie nature, but what are my options here to get this running in production?
@damian you can edit it to use
require.main.requirefor requiring nconf and then submit a PR to the plugin's GitHub. Open an issue about it, too.
Can you link the plugin so I can look at it?
Actually i'm beginner for Mean Stack, and i got an idea regarding this topic thank you all.....