@iad-os/react-ghost-auth
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -46,2 +46,3 @@ import { AxiosStatic } from 'axios'; | ||
children: React.ReactNode; | ||
onRoute: (route: string) => void; | ||
needAuthorization?: (serviceUrl: string, requestUrl: string) => boolean; | ||
@@ -48,0 +49,0 @@ onTokenRequest?: (axios: AxiosStatic, data: { |
@@ -796,3 +796,3 @@ import { jsx, jsxs } from 'react/jsx-runtime'; | ||
function AuthenticationProvider(props) { | ||
const { axios, onTokenRequest, onRefreshTokenRequest, config, children, needAuthorization, } = props; | ||
const { axios, onTokenRequest, onRefreshTokenRequest, config, children, needAuthorization, onRoute, } = props; | ||
const providerNameList = Object.keys(config.providers || {}).map(k => k); | ||
@@ -836,3 +836,3 @@ const { providers, serviceUrl, default: defaultProviderName = providerNameList.length > 0 | ||
setTokens(data); | ||
window.location.href = redirect_uri; | ||
onRoute(redirect_uri); | ||
}) | ||
@@ -839,0 +839,0 @@ .catch(function (error) { |
@@ -804,3 +804,3 @@ 'use strict'; | ||
function AuthenticationProvider(props) { | ||
const { axios, onTokenRequest, onRefreshTokenRequest, config, children, needAuthorization, } = props; | ||
const { axios, onTokenRequest, onRefreshTokenRequest, config, children, needAuthorization, onRoute, } = props; | ||
const providerNameList = Object.keys(config.providers || {}).map(k => k); | ||
@@ -844,3 +844,3 @@ const { providers, serviceUrl, default: defaultProviderName = providerNameList.length > 0 | ||
setTokens(data); | ||
window.location.href = redirect_uri; | ||
onRoute(redirect_uri); | ||
}) | ||
@@ -847,0 +847,0 @@ .catch(function (error) { |
{ | ||
"name": "@iad-os/react-ghost-auth", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"maintainers": [ | ||
@@ -5,0 +5,0 @@ { |
170951
1914