node-oauth2-server
Advanced tools
Comparing version 2.2.1 to 2.2.2
## Changelog | ||
### 2.2.2 | ||
- Fix bug when client has multiple redirect_uri's (#84) | ||
### 2.2.1 | ||
@@ -4,0 +8,0 @@ |
@@ -47,3 +47,5 @@ /** | ||
if (data.clientSecret !== clientSecret) return callback(); | ||
if (clientSecret !== null && data.clientSecret !== clientSecret) { | ||
return callback(); | ||
} | ||
@@ -135,5 +137,5 @@ callback(null, data); | ||
if (expires) code.expires = parseInt(expires / 1000, 10); | ||
console.log("saving", token); | ||
console.log("saving", code); | ||
dal.doSet(token, OAuthAuthCodeTable, { authCode: { S: authCode }}, callback); | ||
dal.doSet(code, OAuthAuthCodeTable, { authCode: { S: authCode }}, callback); | ||
}; | ||
@@ -140,0 +142,0 @@ |
@@ -17,3 +17,3 @@ var model = module.exports; | ||
], | ||
refreshToken: [ | ||
refresh_token: [ | ||
'thom' | ||
@@ -66,3 +66,4 @@ ] | ||
var elem = oauthClients[i]; | ||
if(elem.clientId === clientId && elem.clientSecret === clientSecret) { | ||
if(elem.clientId === clientId && | ||
(clientSecret === null || elem.client_secret === clientSecret)) { | ||
return callback(false, elem); | ||
@@ -69,0 +70,0 @@ } |
@@ -73,3 +73,5 @@ /** | ||
console.log('in getClient (clientId: ' + clientId + ', clientSecret: ' + clientSecret + ')'); | ||
if (clientSecret === null) { | ||
return OAuthClientsModel.findOne({ clientId: clientId }, callback); | ||
} | ||
OAuthClientsModel.findOne({ clientId: clientId, clientSecret: clientSecret }, callback); | ||
@@ -76,0 +78,0 @@ }; |
@@ -118,2 +118,3 @@ /** | ||
} | ||
client.redirectUri = self.redirectUri; | ||
} else if (client.redirectUri !== self.redirectUri) { | ||
@@ -120,0 +121,0 @@ return done(error('invalid_request', 'redirect_uri does not match')); |
{ | ||
"name": "node-oauth2-server", | ||
"description": "Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "oauth", |
@@ -129,4 +129,4 @@ # 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) | ||
- *string* **clientId** | ||
- *string|number* **userId** | ||
- *date* **expires** | ||
- *object* **user** | ||
- *function* **callback (error)** | ||
@@ -184,4 +184,4 @@ - *mixed* **error** | ||
- *string* **clientId** | ||
- *string|number* **userId** | ||
- *date* **expires** | ||
- *object* **user** | ||
- *function* **callback (error)** | ||
@@ -274,4 +274,4 @@ - *mixed* **error** | ||
- getUser (username, password, callback) | ||
- saveAccessToken (accessToken, clientId, userId, expires, callback) | ||
- saveRefreshToken (refreshToken, clientId, userId, expires, callback) **(if using)** | ||
- saveAccessToken (accessToken, clientId, expires, user, callback) | ||
- saveRefreshToken (refreshToken, clientId, expires, user, callback) **(if using)** | ||
@@ -278,0 +278,0 @@ Provided there weren't any errors, this will return the following (excluding the `refresh_token` if you've not enabled the refresh_token grant type): |
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
148817
3569