oauth2orize
Advanced tools
Comparing version 1.11.1 to 1.12.0
@@ -9,2 +9,8 @@ # Changelog | ||
## [1.12.0] - 2023-10-13 | ||
### Added | ||
- Optional `extend` callback to `grant.code` setup function, used to extend the | ||
authorization response. Needed to support extensions such as [OpenID Connect | ||
Session Management 1.0](https://openid.net/specs/openid-connect-session-1_0.html). | ||
## [1.11.1] - 2021-11-17 | ||
@@ -20,4 +26,6 @@ ### Fixed | ||
[Unreleased]: https://github.com/jaredhanson/oauth2orize/compare/v1.11.0...HEAD | ||
[Unreleased]: https://github.com/jaredhanson/oauth2orize/compare/v1.12.0...HEAD | ||
[1.11.1]: https://github.com/jaredhanson/oauth2orize/compare/v1.11.1...v1.12.0 | ||
[1.11.1]: https://github.com/jaredhanson/oauth2orize/compare/v1.11.0...v1.11.1 | ||
[1.11.0]: https://github.com/jaredhanson/oauth2orize/compare/v1.10.0...v1.11.0 | ||
[1.10.0]: https://github.com/jaredhanson/oauth2orize/compare/v1.9.0...v1.10.0 |
@@ -5,2 +5,3 @@ /** | ||
var url = require('url') | ||
, utils = require('../utils') | ||
, AuthorizationError = require('../errors/authorizationerror'); | ||
@@ -59,4 +60,5 @@ | ||
*/ | ||
module.exports = function code(options, issue) { | ||
module.exports = function code(options, issue, extend) { | ||
if (typeof options == 'function') { | ||
extend = issue; | ||
issue = options; | ||
@@ -66,2 +68,3 @@ options = undefined; | ||
options = options || {}; | ||
extend = extend || function(txn, cb){ cb(); }; | ||
@@ -165,5 +168,9 @@ if (!issue) { throw new TypeError('oauth2orize.code grant requires an issue callback'); } | ||
if (txn.req && txn.req.state) { params.state = txn.req.state; } | ||
complete(function(err) { | ||
extend(txn, function(err, exparams) { | ||
if (err) { return next(err); } | ||
return respond(txn, res, params); | ||
if (exparams) { utils.merge(params, exparams); } | ||
complete(function(err) { | ||
if (err) { return next(err); } | ||
return respond(txn, res, params); | ||
}); | ||
}); | ||
@@ -170,0 +177,0 @@ } |
{ | ||
"name": "oauth2orize", | ||
"version": "1.11.1", | ||
"version": "1.12.0", | ||
"description": "OAuth 2.0 authorization server toolkit for Node.js.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
96519
2320