New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-oauth2-ts-client

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-oauth2-ts-client - npm Package Compare versions

Comparing version

to
1.0.1

2

dist/core/client.d.ts

@@ -12,3 +12,3 @@ import { OAuth2GrantType, OAuth2Token, OAuthClientSettings, OAuthStartAuthFlow, OAuthStartAuthFlowResponse, RefreshParams } from "../types";

}): Promise<OAuth2Token>;
refreshToken(token: OAuth2Token, params?: RefreshParams): Promise<OAuth2Token>;
refreshToken(refreshToken: string, params?: RefreshParams): Promise<OAuth2Token>;
clientCredentialsGrant(params: {

@@ -15,0 +15,0 @@ scope?: string[];

@@ -32,5 +32,5 @@ "use strict";

}
async refreshToken(token, params) {
async refreshToken(refreshToken, params) {
const grantObj = new OAuthGrant_1.OAuthGrantClass(this.settings);
return grantObj.refreshToken(token, params);
return grantObj.refreshToken(refreshToken, params);
}

@@ -37,0 +37,0 @@ async clientCredentialsGrant(params) {

@@ -9,3 +9,3 @@ import { IgetTokenForCodeParams, OAuth2Token, OAuthClientSettings, OAuthStartAuthFlow, RefreshParams } from "../types";

getTokenForCode(url: string, params: IgetTokenForCodeParams): Promise<OAuth2Token>;
refreshToken(token: OAuth2Token, params?: RefreshParams): Promise<OAuth2Token>;
refreshToken(refreshToken: string, params?: RefreshParams): Promise<OAuth2Token>;
clientCredentialsGrant(params: {

@@ -12,0 +12,0 @@ scope?: string[];

@@ -104,4 +104,4 @@ "use strict";

}
async refreshToken(token, params) {
if (!token.refresh_token) {
async refreshToken(refreshToken, params) {
if (!refreshToken) {
throw new Error("This token didn't have a refreshToken. It's not possible to refresh this");

@@ -111,3 +111,3 @@ }

grant_type: "refresh_token",
refresh_token: token.refresh_token,
refresh_token: refreshToken,
};

@@ -122,3 +122,3 @@ if (!this.client.client_secret) {

if (!newToken.refresh_token) {
newToken.refresh_token = token.refresh_token;
newToken.refresh_token = refreshToken;
}

@@ -125,0 +125,0 @@ return newToken;

{
"name": "simple-oauth2-ts-client",
"version": "1.0.0",
"version": "1.0.1",
"description": "A TypeScript OAuth 2.0 client library",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet