Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-oauth2-server

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-oauth2-server - npm Package Compare versions

Comparing version 2.0.0-rc2 to 2.0.0

examples/memory/model.js

2

Changelog.md

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc