changed axios to axiosInstance
This commit is contained in:
parent
2236244266
commit
9b146a4b3a
@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect, createContext, ReactNode } from 'react';
|
import React, { useState, useEffect, createContext, ReactNode } from 'react';
|
||||||
import { User } from '../types';
|
import { User } from '../types';
|
||||||
import axios from 'axios';
|
import { axiosInstance } from '../utils/axiosInstance';
|
||||||
|
|
||||||
export interface CASContext {
|
export interface CASContext {
|
||||||
user?: User;
|
user?: User;
|
||||||
@ -29,7 +29,7 @@ export const CASProvider = ({ children }: CASProviderProps) => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!sessionStorage.getItem('userToken')) {
|
if (!sessionStorage.getItem('userToken')) {
|
||||||
const { data: token } = await axios.get(`${process.env.REACT_APP_API_URL}/token?ticket=${ticket}`);
|
const { data: token } = await axiosInstance.get(`${process.env.REACT_APP_API_URL}/token?ticket=${ticket}`);
|
||||||
sessionStorage.setItem('userToken', token);
|
sessionStorage.setItem('userToken', token);
|
||||||
}
|
}
|
||||||
const token = sessionStorage.getItem('userToken');
|
const token = sessionStorage.getItem('userToken');
|
||||||
|
Loading…
Reference in New Issue
Block a user