loopback-component-oauth2
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -0,1 +1,7 @@ | ||
2015-06-18, Version 2.3.1 | ||
========================= | ||
* Allow checkAccessToken to a custom function (Raymond Feng) | ||
2015-06-18, Version 2.3.0 | ||
@@ -2,0 +8,0 @@ ========================= |
@@ -42,2 +42,3 @@ /** | ||
var handlers = {}; | ||
app._oauth2Handlers = handlers; | ||
@@ -831,5 +832,3 @@ // Default to true | ||
app._oauth2Handlers = handlers; | ||
return handlers; | ||
}; |
@@ -28,3 +28,3 @@ var async = require('async') | ||
function accessTokenValidator(req, accessToken, done) { | ||
function checkAccessToken(accessToken, done) { | ||
debug('Verifying access token %s', accessToken); | ||
@@ -88,4 +88,3 @@ models.accessTokens.find(accessToken, function(err, token) { | ||
var authInfo = | ||
{ accessToken: token, user: user, app: app, client: app }; | ||
req.accessToken = token; | ||
{accessToken: token, user: user, app: app, client: app}; | ||
done(null, user || {}, authInfo); | ||
@@ -96,2 +95,16 @@ }); | ||
var verifyAccessToken = checkAccessToken; | ||
if (typeof options.checkAccessToken === 'function') { | ||
verifyAccessToken = options.checkAccessToken; | ||
} | ||
function accessTokenValidator(req, accessToken, done) { | ||
verifyAccessToken(accessToken, function(err, user, info) { | ||
if(!err && info) { | ||
req.accessToken = info.accessToken; | ||
} | ||
done(err, user, info); | ||
}); | ||
} | ||
/** | ||
@@ -98,0 +111,0 @@ * BearerStrategy |
{ | ||
"name": "loopback-component-oauth2", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "OAuth 2.0 provider for LoopBack", | ||
@@ -51,3 +51,3 @@ "keywords": [ | ||
"optionalDependencies": { | ||
"sl-blip": "http://blip.strongloop.com/loopback-component-oauth2@2.3.0" | ||
"sl-blip": "http://blip.strongloop.com/loopback-component-oauth2@2.3.1" | ||
}, | ||
@@ -54,0 +54,0 @@ "engines": { |
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
460223
4334