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

@jfront/oauth-context

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jfront/oauth-context - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.1.3](https://github.com/Jepria/jfront-oauth/compare/@jfront/oauth-context@0.1.2...@jfront/oauth-context@0.1.3) (2020-09-07)
### Bug Fixes
* axios removed useEffect hook ([a006f5b](https://github.com/Jepria/jfront-oauth/commit/a006f5b9c325dc1d93704fd08b1fe7684907cea8))
## [0.1.2](https://github.com/Jepria/jfront-oauth/compare/@jfront/oauth-context@0.1.1...@jfront/oauth-context@0.1.2) (2020-09-07)

@@ -8,0 +19,0 @@

30

dist/cjs/OAuthContextProvider.js

@@ -141,21 +141,19 @@ "use strict";

(0, _react.useEffect)(function () {
if (configureAxios && axiosInstance && accessToken) {
axiosInstance.defaults.headers["Authorization"] = "Bearer " + accessToken;
axiosInstance.interceptors.response.use(function (response) {
if (401 === (response == null ? void 0 : response.status)) {
authorize();
}
if (configureAxios && axiosInstance && accessToken) {
axiosInstance.defaults.headers["Authorization"] = "Bearer " + accessToken;
axiosInstance.interceptors.response.use(function (response) {
if (401 === (response == null ? void 0 : response.status)) {
authorize();
}
return response;
}, function (error) {
var _error$response;
return response;
}, function (error) {
var _error$response;
if (401 === (error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status)) {
authorize();
}
});
} // eslint-disable-next-line react-hooks/exhaustive-deps
if (401 === (error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status)) {
authorize();
}
});
}
}, [accessToken]);
return /*#__PURE__*/_react["default"].createElement(_OAuthContext.OAuthContext.Provider, {

@@ -162,0 +160,0 @@ value: {

@@ -129,21 +129,19 @@ import React, { useReducer, useEffect } from "react";

useEffect(() => {
if (configureAxios && axiosInstance && accessToken) {
axiosInstance.defaults.headers["Authorization"] = "Bearer " + accessToken;
axiosInstance.interceptors.response.use(response => {
if (401 === (response == null ? void 0 : response.status)) {
authorize();
}
if (configureAxios && axiosInstance && accessToken) {
axiosInstance.defaults.headers["Authorization"] = "Bearer " + accessToken;
axiosInstance.interceptors.response.use(response => {
if (401 === (response == null ? void 0 : response.status)) {
authorize();
}
return response;
}, error => {
var _error$response;
return response;
}, error => {
var _error$response;
if (401 === (error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status)) {
authorize();
}
});
} // eslint-disable-next-line react-hooks/exhaustive-deps
if (401 === (error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status)) {
authorize();
}
});
}
}, [accessToken]);
return /*#__PURE__*/React.createElement(OAuthContext.Provider, {

@@ -150,0 +148,0 @@ value: {

{
"name": "@jfront/oauth-context",
"version": "0.1.2",
"version": "0.1.3",
"license": "Apache-2.0",

@@ -40,3 +40,3 @@ "repository": "https://github.com/Jepria/jfront-oauth",

},
"gitHead": "b3d8f7cbdda2a88dcff3ebd900ed6c8915dd1fa1"
"gitHead": "07190351e6fee1545e4acb1fa925e0c538a655b5"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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