@nymdev/express-nymag-user
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@nymdev/express-nymag-user", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Handles in-house authentication as middleware for express via a cookie", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint && mocha" | ||
}, | ||
"repository": { | ||
@@ -10,0 +7,0 @@ "type": "git", |
@@ -12,12 +12,15 @@ Express NYMag User | ||
```js | ||
app.use(require('@nymdev/express-nymag-user')({ | ||
const express = require('express'), | ||
app = express(), | ||
expressNYMagAuth = require('@nymdev/express-nymag-auth'), | ||
authServer = 'http://auth.nymag.com:5000/login?redirect_to='; | ||
//what domains to enable blocking for | ||
blockDomains: ['qa.nymag.com', 'nymag.com', 'nymetro.com'], | ||
//logic for blocking | ||
app.use(expressNYMagAuth({ | ||
blockDomains: ['nymag.com'], | ||
redirectTo: function (originalUrl) { | ||
return authServer + encodeURIComponent(originalUrl); | ||
}, | ||
isProtected: function (req) { | ||
return !!req.query.edit; | ||
} | ||
})); | ||
@@ -30,2 +33,2 @@ ``` | ||
npm install --save @nymdev/express-nymag-auth | ||
``` | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3996
33