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

oidc-react

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oidc-react - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0-alpha

3

build/src/AuthContext.d.ts
import React, { FC } from 'react';
import { UserManager } from 'oidc-client';
import { Location, AuthProviderProps, AuthContextProps } from './AuthContextInterface';
export declare const AuthContext: React.Context<AuthContextProps | undefined>;
export declare const defaultAuthContext: AuthContextProps;
export declare const AuthContext: React.Context<AuthContextProps>;
export declare const hasCodeInUrl: (location: Location) => boolean;
export declare const initUserManager: (props: AuthProviderProps) => UserManager;
export declare const AuthProvider: FC<AuthProviderProps>;

@@ -42,6 +42,15 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthProvider = exports.initUserManager = exports.hasCodeInUrl = exports.AuthContext = void 0;
exports.AuthProvider = exports.initUserManager = exports.hasCodeInUrl = exports.AuthContext = exports.defaultAuthContext = void 0;
const react_1 = __importStar(require("react"));
const oidc_client_1 = require("oidc-client");
exports.AuthContext = react_1.default.createContext(undefined);
exports.defaultAuthContext = {
signIn: () => Promise.reject(new Error('AuthContext not loaded yet.')),
signInPopup: () => Promise.reject(new Error('AuthContext not loaded yet.')),
signOut: () => Promise.reject(new Error('AuthContext not loaded yet.')),
signOutRedirect: () => Promise.reject(new Error('AuthContext not loaded yet.')),
userManager: {},
userData: null,
isLoading: true,
};
exports.AuthContext = react_1.default.createContext(exports.defaultAuthContext);
exports.hasCodeInUrl = (location) => {

@@ -48,0 +57,0 @@ const searchParams = new URLSearchParams(location.search);

import { AuthContextProps } from './AuthContextInterface';
export declare const useAuth: () => AuthContextProps;
export declare const useAuth: (ssr?: boolean | undefined) => AuthContextProps;

@@ -6,5 +6,5 @@ "use strict";

const AuthContext_1 = require("./AuthContext");
exports.useAuth = () => {
exports.useAuth = (ssr) => {
const context = react_1.useContext(AuthContext_1.AuthContext);
if (!context) {
if (!ssr && context === AuthContext_1.defaultAuthContext) {
throw new Error('AuthProvider context is undefined, please verify you are calling useAuth() as child of a <AuthProvider> component.');

@@ -11,0 +11,0 @@ }

{
"name": "oidc-react",
"version": "1.5.1",
"version": "1.6.0-alpha",
"private": false,

@@ -32,3 +32,3 @@ "description": "",

"@types/jest": "^26.0.10",
"@types/node": "^12.12.6",
"@types/node": "^14.14.41",
"@types/react": "^17.0.3",

@@ -35,0 +35,0 @@ "@typescript-eslint/eslint-plugin": "^4.2.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