Merge branch 'master' into staging_environment

This commit is contained in:
csawatzky 2025-05-08 15:22:08 -06:00
commit 5f9d39e26d
13 changed files with 406 additions and 33 deletions

View file

@ -34,7 +34,7 @@ export const HTTPContext = createContext<IHTTPContext>({} as IHTTPContext);
export default function HTTPProvider(props: Props) {
const { children, token } = props;
const { isAuthenticated, /*loginWithRedirect,*/ loginWithPopup } = useAuth0();
const { isAuthenticated, loginWithRedirect } = useAuth0();
const defaultOptions = (demo: boolean = false) => {
if (demo || !isAuthenticated || !token) {
@ -79,7 +79,7 @@ export default function HTTPProvider(props: Props) {
function get<T>(url: string, spreadOptions?: AxiosRequestConfig): Promise<AxiosResponse<T>> {
if (isTokenExpired(token)) {
loginWithPopup()
loginWithRedirect()
}
return axios.get(url, {...defaultOptions(), ...spreadOptions});
}