From b367b994ccf74958593879efc7331bdd2a3d6157 Mon Sep 17 00:00:00 2001 From: William Luke Date: Fri, 20 Sep 2019 18:57:09 +0300 Subject: [PATCH] fix: Fix Types --- package.json | 2 +- src/AuthProvider.tsx | 4 ++-- src/useAuth.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ab51b98..eb41900 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "use-auth0", - "version": "0.1.1", + "version": "0.1.2", "main": "dist/index.js", "module": "dist/useauth0.esm.js", "typings": "dist/index.d.ts", diff --git a/src/AuthProvider.tsx b/src/AuthProvider.tsx index 08bdb8c..8d3e718 100644 --- a/src/AuthProvider.tsx +++ b/src/AuthProvider.tsx @@ -1,5 +1,5 @@ import React, { createContext, useReducer, useEffect, useState } from "react"; -import Auth0, { Auth0UserProfile, Auth0DecodedHash, Auth0Error } from "auth0-js"; +import Auth0, { Auth0UserProfile, Auth0DecodedHash, Auth0Error, WebAuth } from "auth0-js"; import { authReducer, AuthReducerAction } from "./authReducer"; import { handleAuthResult } from "./useAuth"; @@ -15,7 +15,7 @@ export interface AuthState { export interface AuthContextState { state: AuthState; dispatch: React.Dispatch; - auth0: Auth0.WebAuth; + auth0: WebAuth; callback_domain: string; navigate: any; } diff --git a/src/useAuth.tsx b/src/useAuth.tsx index dc5f2d7..70a0feb 100644 --- a/src/useAuth.tsx +++ b/src/useAuth.tsx @@ -1,11 +1,11 @@ import { useContext } from "react"; -import Auth0, { Auth0DecodedHash } from "auth0-js"; +import { Auth0DecodedHash, Auth0ParseHashError, Auth0Error, WebAuth } from "auth0-js"; import { AuthContext } from "./AuthProvider"; import { AuthReducerAction } from 'authReducer'; interface SetSession { dispatch: React.Dispatch; - auth0: Auth0.WebAuth; + auth0: WebAuth; authResult: Auth0DecodedHash; } @@ -31,9 +31,9 @@ async function setSession({ dispatch, auth0, authResult }: SetSession) { }); } interface HandleAuthResult { - err?: Auth0.Auth0Error | Auth0.Auth0ParseHashError | null; + err?: Auth0Error | Auth0ParseHashError | null; dispatch: React.Dispatch; - auth0: Auth0.WebAuth; + auth0: WebAuth; authResult: Auth0DecodedHash | null; } export const handleAuthResult = async ({