trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
265 stars 141 forks source link

BasicAuth deactivated when http #99

Closed sylvainlap closed 8 years ago

sylvainlap commented 8 years ago

Hi,

For my application, I need BasicAuth. I'm aware that for BasicAuth, https is mandatory. However, in my PROD environment, https is handled by nginx, not sails. So, that piece of code in api/policies/basicAuth.js is irrelevant:

if (process.env.NODE_ENV === 'production' && !req.secure) {
    return res.status(403).json({ error: 'https required for basic auth. refusing login request' });
  }

Because even if the sails req is not secure, security is handled upstream thanks to nginx.

What about removing this check ?