All files / lib/apis/auth index.ts

0% Statements 0/8
100% Branches 0/0
100% Functions 0/0
0% Lines 0/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
/* eslint-disable no-param-reassign */
import axios from 'axios';
import {
  AuthApi,
  OAuthExchangeApi,
  Configuration as AuthInterfaceConfiguration
} from '@uniquegood/realworld-auth-interface';
 
export const AUTH_SERVER_HOST = {
  production: 'auth.realworld.to',
  development: 'auth-test.realworld.to'
};
 
const axiosInstance = axios.create({ withCredentials: true });
 
const configuration = new AuthInterfaceConfiguration({
  basePath: `https://${AUTH_SERVER_HOST.production}`
});
export const authApi = new AuthApi(configuration, undefined, axiosInstance);
 
export const oauthExchangeApi = new OAuthExchangeApi(configuration, undefined, axiosInstance);
 
const configurationForDevelopment = new AuthInterfaceConfiguration({
  basePath: `https://${AUTH_SERVER_HOST.development}`
});
 
export const authDevelopmentApi = new AuthApi(
  configurationForDevelopment,
  undefined,
  axiosInstance
);
 
export const oauthExchangeDevelopmentApi = new OAuthExchangeApi(
  configurationForDevelopment,
  undefined,
  axiosInstance
);