oauth2orize-koa
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -21,10 +21,10 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
* | ||
* function(client, username, password, scope, done) { ... } | ||
* async function(client, username, password, scope) { ... } | ||
* | ||
* `client` is the authenticated client instance attempting to obtain an access | ||
* token. `username` and `password` and the resource owner's credentials. | ||
* `scope` is the scope of access requested by the client. `done` is called to | ||
* `scope` is the scope of access requested by the client. `return` to | ||
* issue an access token: | ||
* | ||
* done(err, accessToken, refreshToken, params) | ||
* return [accessToken, refreshToken, params] | ||
* | ||
@@ -44,7 +44,5 @@ * `accessToken` is the access token that will be sent to the client. An | ||
* | ||
* server.exchange(oauth2orize.exchange.password(function(client, username, password, scope, done) { | ||
* AccessToken.create(client, username, password, scope, function(err, accessToken) { | ||
* if (err) { return done(err); } | ||
* done(null, accessToken); | ||
* }); | ||
* server.exchange(oauth2orize.exchange.password(async function(client, username, password, scope) { | ||
* let accessToken = await AccessToken.create(client, username, password, scope); | ||
* return accessToken | ||
* })); | ||
@@ -51,0 +49,0 @@ * |
@@ -122,3 +122,3 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
return function () { | ||
var ref = _asyncToGenerator(function* (ctx) { | ||
var ref = _asyncToGenerator(function* (ctx, next) { | ||
if (!ctx.session) { | ||
@@ -242,6 +242,8 @@ throw new Error('OAuth2orize requires session support. Did you forget app.use(express.session(...))?'); | ||
txns[tid] = txn; | ||
yield next(); | ||
} | ||
}); | ||
return function authorization(_x) { | ||
return function authorization(_x, _x2) { | ||
return ref.apply(this, arguments); | ||
@@ -248,0 +250,0 @@ }; |
@@ -39,3 +39,3 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
return function () { | ||
var ref = _asyncToGenerator(function* (ctx) { | ||
var ref = _asyncToGenerator(function* (ctx, next) { | ||
if (!ctx.session) { | ||
@@ -75,5 +75,7 @@ throw new Error('OAuth2orize requires session support. Did you forget app.use(express.session(...))?'); | ||
ctx.state.oauth2.info = txn.info; | ||
yield next(); | ||
}); | ||
return function transactionLoader(_x) { | ||
return function transactionLoader(_x, _x2) { | ||
return ref.apply(this, arguments); | ||
@@ -80,0 +82,0 @@ }; |
{ | ||
"name": "oauth2orize-koa", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"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
87634