Add password input
This commit is contained in:
@@ -28,13 +28,15 @@ export default function AxiosProvider({
|
||||
|
||||
const publicApi = useMemo(() => {
|
||||
const api = axios.create({
|
||||
baseURL: apiUrl
|
||||
baseURL: apiUrl,
|
||||
withCredentials: true
|
||||
});
|
||||
return api;
|
||||
}, [apiUrl]);
|
||||
const authorizedApi = useMemo(() => {
|
||||
const api = axios.create({
|
||||
baseURL: apiUrl
|
||||
baseURL: apiUrl,
|
||||
withCredentials: true
|
||||
});
|
||||
api.interceptors.request.use(async (config) => {
|
||||
try{
|
||||
|
||||
@@ -26,7 +26,7 @@ export const defaultTokenData: TokenData = {
|
||||
}
|
||||
|
||||
export async function fetchToken(apiUrl: string){
|
||||
const res = await fetch(`${apiUrl}/refresh`);
|
||||
const res = await fetch(`${apiUrl}/auth/refresh`, { method: "POST", credentials: "include" });
|
||||
return await res.json() as TokenResponse;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user