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.6.0 to 1.6.1

9

dist/AuthContext.js

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

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