jaredhanson / passport-oauth2

OAuth 2.0 authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-oauth2/?utm_source=github&utm_medium=referral&utm_campaign=passport-oauth2&utm_content=about
MIT License
607 stars 343 forks source link

depends on req.query #129

Open stocks29 opened 4 years ago

stocks29 commented 4 years ago

This module depends on req.query which means it won't work with vanilla connect but requires express. adding a small middleware like this solves the issue. maybe it can be worked in somehow.

  app.use((req, res, next) => {
    req.query = url.parse(req.url, true).query;
    next();
  });
jackbuehner commented 2 years ago

The usage of req.query also causes issues if an app changes the query parser (e.g. changing it to be an instance of URLSearchParams). Perhaps there should be a way to directly provide the queries.