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

simple-oauth2

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-oauth2 - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

.nyc_output/1a87e6e8b463dbc9eec47a337220038c.json

4

CHANGELOG.md
# Changelog
## v2.0.1
* Add support to revoke accessToken and refreshToken in a single call with `revokeAll`
## v2.0.0

@@ -4,0 +8,0 @@

@@ -67,2 +67,10 @@ 'use strict';

}
/**
* Revoke both the existing access and refresh tokens
*/
async revokeAll() {
await this.revoke('access_token');
await this.revoke('refresh_token');
}
}

@@ -69,0 +77,0 @@

4

package.json
{
"name": "simple-oauth2",
"version": "2.0.0",
"version": "2.0.1",
"description": "Node.js client for OAuth2",

@@ -53,3 +53,3 @@ "author": "Andrea Reginato <andrea.reginato@gmail.com>",

"lodash": "^4.17.5",
"mocha": "^4.0.1",
"mocha": "^5.0.1",
"nock": "^9.0.13",

@@ -56,0 +56,0 @@ "nyc": "^11.4.1"

@@ -136,3 +136,4 @@ # Simple OAuth2

code: '<code>',
redirect_uri: 'http://localhost:3000/callback'
redirect_uri: 'http://localhost:3000/callback',
scope: '<scope>', // also can be an array of multiple scopes, ex. ['<scope1>, '<scope2>', '...']
};

@@ -163,3 +164,4 @@

username: 'username',
password: 'password'
password: 'password',
scope: '<scope>', // also can be an array of multiple scopes, ex. ['<scope1>, '<scope2>', '...']
};

@@ -182,3 +184,5 @@

const oauth2 = require('simple-oauth2').create(credentials);
const tokenConfig = {};
const tokenConfig = {
scope: '<scope>', // also can be an array of multiple scopes, ex. ['<scope1>, '<scope2>', '...']
};

@@ -255,7 +259,6 @@ // Get the access token object for the client

```javascript
// Revoke both access and refresh tokens
try {
// Revoke only the access token
await accessToken.revoke('access_token')
await accessToken.revoke('access_token');

@@ -270,2 +273,14 @@ // Session ended. But the refresh_token is still valid.

As a convenience method, you can also revoke both tokens in a single call:
```javascript
// Revoke both access and refresh tokens
try {
// Revokes both tokens, refresh token is only revoked if the access_token is properly revoked
await accessToken.revokeAll();
} catch (error) {
console.log('Error revoking token: ', error.message);
}
```
### Errors

@@ -272,0 +287,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