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

react-oauth2-code-pkce

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-oauth2-code-pkce - npm Package Compare versions

Comparing version 1.10.4 to 1.11.0

7

dist/AuthContext.js

@@ -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 @@

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