• I am trying to make the authorization for nodebb by link. I try to use the strategy passport-http-bearer

    var Strategy = require('passport-http-bearer').Strategy;
    var passport_two = require('passport');
    passport_two.use(new Strategy(
      function(token, cb) {
        //db.users.findById(token, function(err, user) {
         // if (err) { return cb(err); }
        //  if (!user) { return cb(null, false); }
          return cb(null, 1); // where 1 number user for example
      passport_two.authenticate('bearer', { session: true }),
      function(req, res) {

    but there is no authorization. Why?

    How I can authorization a user on the site by email or id?

  • GNU/Linux Admin

    Is this a plugin in NodeBB? You'll need to add the routes by listening to the static:app.init hook.

Suggested Topics

| |