From 3ac04701dc603695f3029d7156ae0f1d7de15ba5 Mon Sep 17 00:00:00 2001 From: Pavel Kabakin Date: Tue, 26 Apr 2016 19:19:18 +0300 Subject: [PATCH 1/2] Update oauth2-server --- index.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fda674f..8fb8b08 100644 --- a/index.js +++ b/index.js @@ -41,10 +41,11 @@ KoaOAuthServer.prototype.authenticate = function() { return function *(next) { var request = new Request(this.request); + var response = new Response(this.response); try { this.state.oauth = { - token: yield server.authenticate(request) + token: yield server.authenticate(request, response) }; } catch (e) { return handleError.call(this, e); diff --git a/package.json b/package.json index b21df78..0d53ba6 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "license": "MIT", "dependencies": { "co": "^4.5.1", - "oauth2-server": "seegno-forks/node-oauth2-server#enhancement/refactor-project" + "oauth2-server": "^3.0.0-b2" }, "devDependencies": { "co-mocha": "^1.1.0", From 1c151090804c65aa12337c6f8f1231f55c32de26 Mon Sep 17 00:00:00 2001 From: Luciano Ganga Date: Wed, 1 Jun 2016 12:36:19 -0300 Subject: [PATCH 2/2] Add an option parameter to the authorize middleware, so it's possible to pass options such as 'authenticateHandler' --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fda674f..2f3ec9a 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,7 @@ KoaOAuthServer.prototype.authenticate = function() { * (See: https://tools.ietf.org/html/rfc6749#section-3.1) */ -KoaOAuthServer.prototype.authorize = function() { +KoaOAuthServer.prototype.authorize = function(options) { var server = this.server; return function *(next) { @@ -71,7 +71,7 @@ KoaOAuthServer.prototype.authorize = function() { try { this.state.oauth = { - code: yield server.authorize(request, response) + code: yield server.authorize(request, response, options) }; handleResponse.call(this, response);