Giter VIP home page Giter VIP logo

Comments (3)

rkusa avatar rkusa commented on May 26, 2024

Would it help to not use the global instance in your express app?

const instance = new passport.Passport()

from koa-passport.

Inoir avatar Inoir commented on May 26, 2024

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.

rkusa avatar rkusa commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.