heroku-bouncer
Advanced tools
Comparing version 3.1.1 to 3.1.2
'use strict'; | ||
var encryptor = require('encryptor'); | ||
var encryptor = require('simple-encryptor'); | ||
var request = require('request'); | ||
@@ -40,3 +40,3 @@ | ||
if (currentSession) { | ||
var userSession = JSON.parse(cipher.decrypt(currentSession)); | ||
var userSession = cipher.decrypt(currentSession); | ||
var isHerokai = /@heroku\.com$/.test(userSession.user.email); | ||
@@ -58,3 +58,3 @@ | ||
req.session.userSession = cipher.encrypt(JSON.stringify(userSession)); | ||
req.session.userSession = cipher.encrypt(userSession); | ||
@@ -61,0 +61,0 @@ req['heroku-bouncer'] = { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var OAuth = require('oauth').OAuth2; | ||
var encryptor = require('encryptor'); | ||
var encryptor = require('simple-encryptor'); | ||
var express = require('express'); | ||
@@ -50,3 +50,3 @@ var heroku = require('heroku-client'); | ||
var userSession = JSON.stringify({ | ||
var userSession = { | ||
accessToken : accessToken, | ||
@@ -62,3 +62,3 @@ refreshToken: refreshToken, | ||
} | ||
}); | ||
}; | ||
@@ -65,0 +65,0 @@ var redirectPath; |
{ | ||
"name": "heroku-bouncer", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "heroku bouncer middleware for express", | ||
@@ -20,3 +20,2 @@ "main": "index.js", | ||
"dependencies": { | ||
"encryptor": "~0.1.0", | ||
"oauth": "~0.9.11", | ||
@@ -26,3 +25,4 @@ "express": "~4.1.1", | ||
"bluebird": "^2.2.2", | ||
"request": "^2.37.0" | ||
"request": "^2.37.0", | ||
"simple-encryptor": "^1.0.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
@@ -41,3 +41,3 @@ # node-heroku-bouncer [![Build Status](https://travis-ci.org/jclem/node-heroku-bouncer.svg?branch=master)](https://travis-ci.org/jclem/node-heroku-bouncer) | ||
herokuOAuthSecret : 'client-secret', | ||
herokuBouncerSecret: 'bouncer-secret' | ||
herokuBouncerSecret: 'abcd1234abcd1234' | ||
}); | ||
@@ -44,0 +44,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
var bouncer = require('../../index')(options); | ||
var cipher = require('encryptor')('bouncer-secret'); | ||
var cipher = require('simple-encryptor')('abcd1234abcd1234'); | ||
@@ -33,3 +33,3 @@ app.use(require('cookie-parser')('cookie secret')); | ||
if (req.session.userSession) { | ||
res.set('x-user-session', cipher.decrypt(req.session.userSession)); | ||
res.set('x-user-session', JSON.stringify(cipher.decrypt(req.session.userSession))); | ||
} | ||
@@ -36,0 +36,0 @@ |
@@ -13,3 +13,3 @@ 'use strict'; | ||
herokuOAuthSecret : 'client-secret', | ||
herokuBouncerSecret: 'bouncer-secret', | ||
herokuBouncerSecret: 'abcd1234abcd1234', | ||
herokuAuthURL : 'http://localhost:' + oAuthServer.address().port, | ||
@@ -16,0 +16,0 @@ herokaiOnlyRedirect: '/herokai-only', |
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
32745
+ Addedsimple-encryptor@^1.0.2
- Removedencryptor@~0.1.0
- Removedencryptor@0.1.0(transitive)