Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -62,7 +63,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) {
Expand All @@ -71,7 +72,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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down