node-oauth2-server
Advanced tools
Comparing version 2.0.0-rc2 to 2.0.0
@@ -58,2 +58,2 @@ ## Changelog | ||
- Use async crypto.randomBytes in token generation | ||
- Refactor structure, break into more files | ||
- Refactor structure, break into more files |
@@ -151,2 +151,2 @@ # DynamoDB Example | ||
}; | ||
``` | ||
``` |
@@ -69,2 +69,14 @@ /** | ||
model.getRefreshToken = function (bearerToken, callback) { | ||
pg.connect(connString, function (err, client, done) { | ||
if (err) return callback(err); | ||
client.query('SELECT refresh_token, client_id, expires, user_id FROM oauth_refresh_tokens ' + | ||
'WHERE refresh_token = $1', [bearerToken], function (err, result) { | ||
// The returned user_id will be exposed in req.user.id | ||
callback(err, result.rowCount ? result.rows[0] : false); | ||
done(); | ||
}); | ||
}); | ||
}; | ||
// This will very much depend on your setup, I wouldn't advise doing anything exactly like this but | ||
@@ -81,3 +93,3 @@ // it gives an example of how to use the method to resrict certain grant types | ||
model.saveAccessToken = function (accessToken, clientId, userId, expires, callback) { | ||
model.saveAccessToken = function (accessToken, clientId, expires, userId, callback) { | ||
pg.connect(connString, function (err, client, done) { | ||
@@ -84,0 +96,0 @@ if (err) return callback(err); |
@@ -5,3 +5,3 @@ # PostgreSQL Example | ||
The object exposed in model.js could be directly passed into the model paramater of the config | ||
The object exposed in model.js could be directly passed into the model parameter of the config | ||
object when initiating. | ||
@@ -26,2 +26,2 @@ | ||
... | ||
``` | ||
``` |
@@ -59,3 +59,3 @@ /** | ||
return self.config.continueAfterResponse ? next() : null; | ||
return self.continueAfterResponse ? next() : null; | ||
} | ||
@@ -62,0 +62,0 @@ |
@@ -423,4 +423,4 @@ /** | ||
if (this.config.continueAfterResponse) | ||
if (this.continueAfterResponse) | ||
done(); | ||
} |
@@ -41,3 +41,3 @@ /** | ||
this.passthroughErrors = config.passthroughErrors; | ||
this.continueAfterResponse = config.continueAfterResponse; | ||
this.continueAfterReponse = config.continueAfterReponse; | ||
@@ -44,0 +44,0 @@ this.accessTokenLifetime = config.accessTokenLifetime !== undefined ? |
{ | ||
"name": "node-oauth2-server", | ||
"description": "Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js", | ||
"version": "2.0.0-rc2", | ||
"version": "2.0.0", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "oauth", |
@@ -5,2 +5,5 @@ # Node OAuth2 Server [![Build Status](https://travis-ci.org/thomseddon/node-oauth2-server.png?branch=2.0)](https://travis-ci.org/thomseddon/node-oauth2-server) | ||
## 2.0 | ||
Version is under active development, for a preview see the 2.0 branch: https://github.com/thomseddon/node-oauth2-server/tree/2.0 | ||
## Installation | ||
@@ -7,0 +10,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
137307
37
3241
1
304