react-oauth2-code-pkce
Advanced tools
Comparing version 1.15.2 to 1.15.3
@@ -74,3 +74,3 @@ "use strict"; | ||
} | ||
const tokenRequest = Object.assign(Object.assign({ grant_type: 'authorization_code', code: authCode, scope: config.scope, client_id: config.clientId, redirect_uri: config.redirectUri, code_verifier: codeVerifier }, config.extraTokenParameters), config.extraAuthParams); | ||
const tokenRequest = Object.assign(Object.assign({ grant_type: 'authorization_code', code: authCode, client_id: config.clientId, redirect_uri: config.redirectUri, code_verifier: codeVerifier }, config.extraTokenParameters), config.extraAuthParams); | ||
return postTokenRequest(config.tokenEndpoint, tokenRequest); | ||
@@ -77,0 +77,0 @@ }; |
import { TTokenResponse } from './Types'; | ||
export declare const FALLBACK_EXPIRE_TIME = 600; | ||
export declare const epochAtSecondsFromNow: (secondsFromNow: number) => number; | ||
export declare const epochAtSecondsFromNow: (secondsFromNow: number | string) => number; | ||
/** | ||
@@ -5,0 +5,0 @@ * Check if the Access Token has expired. |
@@ -6,3 +6,4 @@ "use strict"; | ||
// Returns epoch time (in seconds) for when the token will expire | ||
const epochAtSecondsFromNow = (secondsFromNow) => Math.round(Date.now() / 1000 + secondsFromNow); | ||
// 'secondsFromNow' should always be an integer, but some auth providers has decided that whole numbers should be strings... | ||
const epochAtSecondsFromNow = (secondsFromNow) => Math.round(Date.now() / 1000 + Number(secondsFromNow)); | ||
exports.epochAtSecondsFromNow = epochAtSecondsFromNow; | ||
@@ -20,3 +21,3 @@ /** | ||
const refreshExpireKeys = [ | ||
'refresh_expires_in', | ||
'refresh_expires_in', // KeyCloak | ||
'refresh_token_expires_in', // Azure AD | ||
@@ -23,0 +24,0 @@ ]; |
import { ReactNode } from 'react'; | ||
interface TTokenRqBase { | ||
grant_type: string; | ||
scope?: string; | ||
client_id: string; | ||
@@ -13,2 +12,3 @@ redirect_uri: string; | ||
export interface TTokenRequestForRefresh extends TTokenRqBase { | ||
scope?: string; | ||
refresh_token: string; | ||
@@ -15,0 +15,0 @@ } |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.15.2", | ||
"version": "1.15.3", | ||
"description": "Provider agnostic 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
46521
755