Comments (3)
Would it help to not use the global instance in your express app?
const instance = new passport.Passport()
from koa-passport.
Like i said, ive done this. Maybe i should mention, im using esm modules, not commonjs. maybe this is the reason?
The passport.framework(...) call will be still executed and set the framework for every instance created after koa-passport is used. since i cant change the code of the express app, i need to make sure koa-passport is not setting this global or only in the instance.
Edit: To mention here also the express app is importing the global passport. So i cant use an instance in there.
Current workaround is to reset your settings after i imported koa-passport, so just set the default framework again.
Would still prefer to have an "better" solution for this. Seems this problem will maybe affect more ppl, since esm modules is the new standard.
But like i said ive a working solution, so not rly a "bug" anymore. More a feature request to make this somehow configurable
from koa-passport.
I am afraid that I feel like this is too much of an edge case (especially the part of not being able to adjust the express app) and thus not worth adding. Thanks for bringing this up anyway. I'll go ahead and close the issue, but anyone feel free to jump in if you have a similar requirement/use-case.
from koa-passport.
Related Issues (20)
- compatibility issue of koa-passport with apollo-server-koa 2.0
- koa-passport doesn't work with local-strategy? HOT 1
- Delegate Koa's ctx.protocol in request HOT 1
- external session storage does not work HOT 2
- The callback in ctx.login() is not being executed, "Error: Failed to serialize user into session" HOT 9
- Strange behavior for passport.authenticate() function HOT 8
- passport.authenticate("jwt", {session: false}) will not executed. Does koa-passport support JWT strategies? HOT 1
- passport serialize user: next is not a function HOT 2
- mocking request loses original koa app instance, breaking resolving of req.subdomains, because req.app.subdomainOffset is undefined HOT 4
- Documentation | authenticate() HOT 2
- Use koa-passport without koa-session HOT 1
- Not work well with @koa/router in Typescript HOT 2
- koa-passport@next is broken! HOT 1
- Passing multiple strategies to passport.authenticate() HOT 1
- export `AuthenticateOptions` HOT 1
- Should `ctx.state.user` contains `password`? HOT 1
- Update passport to latest version HOT 2
- req.session.regenerate is not a function HOT 17
- Passport authentification - LocalStrategy async/await issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koa-passport.