All files / lib/apis/auth/apiAuthReissueGet index.ts

28.57% Statements 2/7
100% Branches 0/0
0% Functions 0/1
28.57% Lines 2/7

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                1x                                 1x      
import { APP_ENV } from '@lib/config';
import {
  AuthApi,
  Configuration as AuthInterfaceConfiguration
} from '@uniquegood/realworld-auth-interface';
import axios from 'axios';
import moize from 'moize';
 
const apiAuthReissueGet = () => {
  const AUTH_SERVER_HOST = {
    production: 'auth.realworld.to',
    development: 'auth-test.realworld.to'
  }[APP_ENV];
 
  const configuration = new AuthInterfaceConfiguration({
    basePath: `https://${AUTH_SERVER_HOST}`
  });
 
  const defaultAxiosInstance = axios.create({
    withCredentials: true,
    baseURL: `https://${AUTH_SERVER_HOST}`
  });
  const authApi = new AuthApi(configuration, undefined, defaultAxiosInstance);
  return authApi.apiAuthReissueGet();
};
export const memoizedApiAuthReissueGet = moize(apiAuthReissueGet, {
  maxAge: 300000
});