Skip to content

Loading…

Pass arbitrary data (such as scope) via 'info' #88

Closed
wants to merge 2 commits into from

4 participants

@coolaj86

Until this is merged it can be installed with

npm install --save coolaj86/oauth2orize.git#v1.0.1+scope.1
@coolaj86

See the conversation here:
jaredhanson#86

and here:
jaredhanson#87

@jaredhanson
Owner

Right on, thanks! I will get this merged in the next few days.

@coolaj86

please merge and update npm

:-)

@coolaj86

bump a la #72

@atrniv

Why hasn't this been merged yet ? Is there some sort of incompatibility ?

@jaredhanson
Owner

I believe this is fully covered by #110 (updates #87). Closing.

@coolaj86 Let me know if I missed something and need to reconsider.

@jaredhanson jaredhanson closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2014
  1. @coolaj86
Commits on Mar 6, 2014
  1. @coolaj86
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +4 −2 lib/middleware/authorization.js
  2. +1 −0 lib/middleware/transactionLoader.js
View
6 lib/middleware/authorization.js
@@ -136,10 +136,10 @@ module.exports = function(server, options, validate, immediate) {
req.oauth2.req = areq;
req.oauth2.user = req[userProperty];
- function immediated(err, allow, ares) {
+ function immediated(err, allow, info) {
if (err) { return next(err); }
if (allow) {
- req.oauth2.res = ares || {};
+ req.oauth2.res = info || {};
req.oauth2.res.allow = true;
server._respond(req.oauth2, res, function(err) {
@@ -156,12 +156,14 @@ module.exports = function(server, options, validate, immediate) {
var tid = utils.uid(lenTxnID);
req.oauth2.transactionID = tid;
+ req.oauth2.info = info;
var txn = {};
txn.protocol = 'oauth2';
txn.client = obj;
txn.redirectURI = redirectURI;
txn.req = areq;
+ txn.info = info;
// store transaction in session
var txns = req.session[key] = req.session[key] || {};
txns[tid] = txn;
View
1 lib/middleware/transactionLoader.js
@@ -59,6 +59,7 @@ module.exports = function(server, options) {
req.oauth2.client = client;
req.oauth2.redirectURI = txn.redirectURI;
req.oauth2.req = txn.req;
+ req.oauth2.info = txn.info;
next();
});
};
Something went wrong with that request. Please try again.