import axios , { AxiosError , AxiosRequestConfig , AxiosResponse } from 'axios' ; import { resolve } from 'url' ; import * as Sentry from '@sentry/browser' ; export const client = axios . create ( { baseURL : window . config . AUTH_URL } ) ; function request < T > ( options ) { const onSuccess = ( response ) => { return response . data ; } ; const onError = ( error ) => { if ( error . response ) { } else { Sentry . captureException ( error ) ; } throw error ; } ; return client ( options ) . then ( onSuccess ) . catch ( onError ) ; } const invalidateToken = ( token ) : Promise < void > => { return request ( { url : resolve ( window . config . AUTH_URL , 'invalidateToken' ) , method : 'POST' , data : { token } } ) ; } ; export const authApi = { invalidateToken } ;