react-oauth2-code-pkce
Advanced tools
Comparing version 1.10.4 to 1.11.0
@@ -80,8 +80,9 @@ "use strict"; | ||
function handleTokenResponse(response) { | ||
var _a; | ||
var _a, _b, _c; | ||
setToken(response.access_token); | ||
setRefreshToken(response.refresh_token); | ||
const tokenExpiresIn = (_a = response.expires_in) !== null && _a !== void 0 ? _a : timeUtils_1.FALLBACK_EXPIRE_TIME; | ||
const tokenExpiresIn = (_b = (_a = config.tokenExpiresIn) !== null && _a !== void 0 ? _a : response.expires_in) !== null && _b !== void 0 ? _b : timeUtils_1.FALLBACK_EXPIRE_TIME; | ||
setTokenExpire((0, timeUtils_1.epochAtSecondsFromNow)(tokenExpiresIn)); | ||
setRefreshTokenExpire((0, timeUtils_1.epochAtSecondsFromNow)((0, timeUtils_1.getRefreshExpiresIn)(tokenExpiresIn, response))); | ||
const refreshTokenExpiresIn = (_c = config.refreshTokenExpiresIn) !== null && _c !== void 0 ? _c : (0, timeUtils_1.getRefreshExpiresIn)(tokenExpiresIn, response); | ||
setRefreshTokenExpire((0, timeUtils_1.epochAtSecondsFromNow)(refreshTokenExpiresIn)); | ||
setIdToken(response.id_token); | ||
@@ -88,0 +89,0 @@ setLoginInProgress(false); |
@@ -68,2 +68,4 @@ import { ReactNode } from 'react'; | ||
}; | ||
tokenExpiresIn?: number; | ||
refreshTokenExpiresIn?: number; | ||
}; | ||
@@ -98,3 +100,5 @@ export type TRefreshTokenExpiredEvent = { | ||
}; | ||
tokenExpiresIn?: number; | ||
refreshTokenExpiresIn?: number; | ||
}; | ||
export {}; |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.10.4", | ||
"version": "1.11.0", | ||
"description": "Provider agnostic react package for OAuth2 Authorization Code flow with PKCE", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -149,2 +149,6 @@ # 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) | ||
extraAuthParams?: { [key: string]: string | boolean | number } // default: null | ||
// Can be used if auth provider doesn't return access token expiration time in token response | ||
tokenExpiresIn?: number // default: null | ||
// Can be used if auth provider doesn't return refresh token expiration time in token response | ||
refreshTokenExpiresIn?: number // default: null | ||
} | ||
@@ -151,0 +155,0 @@ |
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
40364
668
181