Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasicStrategy not found #79

Open
elspru opened this issue Jan 9, 2019 · 2 comments
Open

BasicStrategy not found #79

elspru opened this issue Jan 9, 2019 · 2 comments

Comments

@elspru
Copy link

elspru commented Jan 9, 2019

There is insufficient documentation to get a working example.

Using the snippet from the README leads to the following error:

/srv/www/routes/v1.js:8
passport.use(new BasicStrategy(
^

ReferenceError: BasicStrategy is not defined
at Object. (/srv/www/routes/v1.js:8:18)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/srv/www/server.js:11:12)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)

@elspru
Copy link
Author

elspru commented Jan 9, 2019

Please add the following line to the README:

const BasicStrategy = require('passport-http').BasicStrategy;

It shouldn't require reading the source code to figure out how to use your library when you have a README. include the require lines and save people countless hours of Error messages and ill feelings.
.

@till
Copy link

till commented Mar 15, 2019

This was helpful, thanks @elspru.

For the record, I tried const BasicStrategy = require('passport-http/strategies/basic'); to no avail. Just presented with a "module not found error".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants