const AUTH_URL = process.env.REACT_APP_AUTH_SERVICE_URL;
const CALLBACK_URL = process.env.REACT_APP_AUTH_CALLBACK_URL;

let signInResponse = {};
let verifyResponse = {};
let refreshResponse = {};

const logResponse = (response) => {
  return response;
};

export default {
  ssoAuthorize: () => `${AUTH_URL}/authorize?redirect=${CALLBACK_URL}`,
  ssoLogout: () => `${AUTH_URL}/logout?redirect=${CALLBACK_URL}`,
  signIn: async (username, password) => logResponse(signInResponse),
  verify: async (idToken) => logResponse(verifyResponse),
  refresh: async (refreshToken) => logResponse(refreshResponse),
  setSignInResponse: (value) => {
    signInResponse = value;
  },
  setVerifyResponse: (value) => {
    verifyResponse = value;
  },
  setRefreshResponse: (value) => {
    refreshResponse = value;
  },
};
