react-oauth2-code-pkce
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -74,3 +74,3 @@ "use strict"; | ||
setLoginInProgress(true); | ||
(0, authentication_1.logIn)(config); | ||
(0, authentication_1.redirectToLogin)(config); | ||
} | ||
@@ -107,3 +107,3 @@ function handleTokenResponse(response) { | ||
logOut(); | ||
(0, authentication_1.logIn)(config); | ||
(0, authentication_1.redirectToLogin)(config); | ||
} | ||
@@ -114,4 +114,3 @@ }); | ||
// The refresh token has expired. Need to log in from scratch. | ||
setLoginInProgress(true); | ||
(0, authentication_1.logIn)(config); | ||
login(); | ||
} | ||
@@ -155,3 +154,3 @@ } | ||
if (config.autoLogin) | ||
(0, authentication_1.logIn)(config); | ||
login(); | ||
} | ||
@@ -158,0 +157,0 @@ else { |
import { TInternalConfig, TTokenData, TTokenResponse } from './Types'; | ||
export declare const EXPIRED_REFRESH_TOKEN_ERROR_CODES: string[]; | ||
export declare function logIn(config: TInternalConfig): Promise<void>; | ||
export declare function redirectToLogin(config: TInternalConfig): Promise<void>; | ||
export declare const fetchTokens: (config: TInternalConfig) => Promise<TTokenResponse>; | ||
@@ -5,0 +5,0 @@ export declare const fetchWithRefreshToken: (props: { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.errorMessageForExpiredRefreshToken = exports.epochTimeIsPast = exports.epochAtSecondsFromNow = exports.decodeJWT = exports.fetchWithRefreshToken = exports.fetchTokens = exports.logIn = exports.EXPIRED_REFRESH_TOKEN_ERROR_CODES = void 0; | ||
exports.errorMessageForExpiredRefreshToken = exports.epochTimeIsPast = exports.epochAtSecondsFromNow = exports.decodeJWT = exports.fetchWithRefreshToken = exports.fetchTokens = exports.redirectToLogin = exports.EXPIRED_REFRESH_TOKEN_ERROR_CODES = void 0; | ||
const pkceUtils_1 = require("./pkceUtils"); | ||
@@ -8,3 +8,3 @@ const codeVerifierStorageKey = 'PKCE_code_verifier'; | ||
exports.EXPIRED_REFRESH_TOKEN_ERROR_CODES = ['AADSTS700084']; | ||
async function logIn(config) { | ||
async function redirectToLogin(config) { | ||
// Create and store a random string in localStorage, used as the 'code_verifier' | ||
@@ -30,3 +30,3 @@ const codeVerifier = (0, pkceUtils_1.generateRandomString)(96); | ||
} | ||
exports.logIn = logIn; | ||
exports.redirectToLogin = redirectToLogin; | ||
// This is called a "type predicate". Which allow us to know which kind of response we got, in a type safe way. | ||
@@ -33,0 +33,0 @@ function isTokenResponse(body) { |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Plug-and-play react package for OAuth2 Authorization Code flow with PKCE", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
27368
512