Comparing version 0.0.10 to 0.0.11
@@ -26,3 +26,3 @@ var ExpressRouter = require('express').Router, | ||
try { | ||
req.user = jwt.decode(req.query.token, options.secret).sub; | ||
res.locals.authbaseId = jwt.decode(req.query.token, options.secret).sub; | ||
options.onAuthenticated(req, res); | ||
@@ -29,0 +29,0 @@ } catch(err) { |
{ | ||
"name": "authbase", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "AuthBase API Client and Router", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -28,3 +28,3 @@ var expect = require('expect.js'), | ||
it('should pass the user as the second argument to the callback on success', function(done) { | ||
var mock = request().reply(200, {id: '123', email: 'foo'}); | ||
var mock = request().reply(200, {id: '123'}); | ||
@@ -37,3 +37,2 @@ proc({ | ||
expect(user.id).to.be('123'); | ||
expect(user.email).to.be('foo'); | ||
@@ -47,3 +46,3 @@ // wrap it up | ||
it('should pass the user to the promise on success', function(done) { | ||
var mock = request().reply(200, {id: '123', email: 'foo'}); | ||
var mock = request().reply(200, {id: '123'}); | ||
@@ -55,3 +54,2 @@ proc({ | ||
expect(user.id).to.be('123'); | ||
expect(user.email).to.be('foo'); | ||
}).catch(function() { | ||
@@ -58,0 +56,0 @@ // shouldn't be here on success, so automatically fail |
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
7245
201