I have this directory structure:
- app/router.js
- app/oauth2-home-client/oauth2-client.js
And the sources:
app/oauth2-home-client/oauth2-client.js
//SOME CODE
exports.Bearer = {
authenticate : passport.authenticate('bearer', { session : false }),
initialize : passport.initialize()
// session : passport.session()
};
app/router.js
var oauth2 = require('./oauth2-home-client/oauth2-client');
console.log(JSON.stringify(oauth2.Bearer));
//SOME CODE
When I print oauth2.Bearer (and oauth2, too) content, I get {}.
What am I doing wrong?
Thanks.
router.jslocated?app/, same directory thatoauth2-home-clientfolder. I have edited my question for clarity.var oauth2 = require('oauth2-home-client/oauth2-client');instead ofvar oauth2 = require('./oauth2-home-client/oauth2-client');oauth2.Bearercurrently it is just possible to tell why you get this result, but not how to solve it. Do you want to dooauth2.Bearer.authenticate()which then should callpassport.authenticate('bearer', { session : false })?