import axios from 'axios'

const instance = axios.create()

export namespace AuthService {
  export const getAuthToken = (backendHost: string): Promise<string> =>
    instance
      .get(`${backendHost}/get_auth_token`, { withCredentials: true })
      .then(response => response.data.authToken)
      .catch(() => console.error('AuthService.getAuthToken'))
}
