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

react-oauth2-code-pkce

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-oauth2-code-pkce - npm Package Compare versions

Comparing version 1.2.2-a to 1.2.2-b

7

dist/AuthContext.js

@@ -61,3 +61,2 @@ "use strict";

.catch(function (error) {
console.log(error);
setError(error);

@@ -70,8 +69,5 @@ if ((0, authentication_1.errorMessageForExpiredRefreshToken)(error)) {

}
else { // The client still has a valid token
setTokenData((0, authentication_1.decodeToken)(token));
}
}
else { // No refresh_token
console.error("Tried to refresh token without a refresh token. Clearing state...");
console.error("Tried to refresh token without a refresh token.");
setError('Bad authorization state. Refreshing the page might solve the issue.');

@@ -106,3 +102,2 @@ }

.catch(function (error) {
console.error(error);
setError(error);

@@ -109,0 +104,0 @@ });

42

dist/authentication.js

@@ -71,2 +71,20 @@ "use strict";

exports.login = login;
function postWithFormData(tokenEndpoint, formData) {
return fetch(tokenEndpoint, {
method: 'POST',
body: formData,
})
.then(function (response) { return response.json()
.then(function (body) {
if (!response.ok) {
console.error(body.error_description);
throw body.error_description;
}
return body;
}); })
.catch(function (error) {
console.error(error);
throw (error === null || error === void 0 ? void 0 : error.message) || error;
});
}
var fetchTokens = function (authConfig) {

@@ -94,13 +112,3 @@ /*

formData.append('code_verifier', codeVerifier);
return fetch(authConfig.tokenEndpoint, {
method: 'POST',
body: formData,
})
.then(function (response) { return response.json().then(function (body) {
if (!response.ok) {
console.error(body.error_description);
throw body.error_description;
}
return body;
}); });
return postWithFormData(authConfig.tokenEndpoint, formData);
};

@@ -116,13 +124,3 @@ exports.fetchTokens = fetchTokens;

formData.append('redirect_uri', authConfig.redirectUri);
return fetch(authConfig.tokenEndpoint, {
method: 'POST',
body: formData,
})
.then(function (response) { return response.json().then(function (body) {
if (!response.ok) {
console.error(body.error_description);
throw body.error_description;
}
return body;
}); });
return postWithFormData(authConfig.tokenEndpoint, formData);
};

@@ -129,0 +127,0 @@ exports.fetchWithRefreshToken = fetchWithRefreshToken;

{
"name": "react-oauth2-code-pkce",
"version": "1.2.2a",
"version": "1.2.2b",
"description": "Plug-and-play react package for OAuth2 Authorization Code flow with PKCE",

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

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