react-oauth2-code-pkce
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -157,2 +157,6 @@ "use strict"; | ||
}, [token]); // This token dependency removes the old, and registers a new Interval when a new token is fetched. | ||
// This ref is used to make sure the 'fetchTokens' call is only made once. | ||
// Multiple calls with the same code will, and should, return an error from the API | ||
// See: https://beta.reactjs.org/learn/synchronizing-with-effects#how-to-handle-the-effect-firing-twice-in-development | ||
const didFetchTokens = (0, react_1.useRef)(false); | ||
// Runs once on page load | ||
@@ -170,3 +174,4 @@ (0, react_1.useEffect)(() => { | ||
} | ||
else { | ||
else if (!didFetchTokens.current) { | ||
didFetchTokens.current = true; | ||
// Request token from auth server with the auth code | ||
@@ -173,0 +178,0 @@ (0, authentication_1.fetchTokens)(config) |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Provider agnostic react package for OAuth2 Authorization Code flow with PKCE", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -118,3 +118,3 @@ # react-oauth2-code-pkce · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/soofstad/react-oauth2-pkce/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/react-oauth2-code-pkce)](https://www.npmjs.com/package/react-oauth2-code-pkce) ![CI](https://github.com/soofstad/react-oauth2-pkce/actions/workflows/tests.yaml/badge.svg) | ||
tokenEndpoint: string // Required | ||
// Which URL the auth provider should redirect the user after loging out | ||
// Which URL the auth provider should redirect the user after successfull authentication/login | ||
redirectUri: string // Required | ||
@@ -125,4 +125,3 @@ // Which scopes to request for the auth token | ||
logoutEndpoint?: string // default: null | ||
// Should be used by the auth provider to decide which URL to redirect | ||
// the user to after logout | ||
// Which URL the auth provider should redirect the user to after logout | ||
logoutRedirect?: string // default: null | ||
@@ -129,0 +128,0 @@ // Optionally provide a callback function to run _before_ the |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39189
649
177