import {
  BASE_API_URL,
  DEFAULT_AUTHORIZATION_TOKEN_EXPIRATION,
  StorageKeys,
} from '../globalConstants';

let tokenExpiration = DEFAULT_AUTHORIZATION_TOKEN_EXPIRATION;

export function setTokenExpiration(expires) {
  tokenExpiration = expires;
}

export function getToken() {
  //return Cookies.get(StorageKeys.AuthorizationToken);
  return localStorage.getItem(StorageKeys.AuthorizationToken)
}

export function setToken(token) {
  localStorage.setItem(StorageKeys.AuthorizationToken, token);
  // Cookies.set(StorageKeys.AuthorizationToken, token, {
  //   expires: new Date(new Date().getTime() + tokenExpiration),
  // });
}

export function removeToken() {
  localStorage.removeItem(StorageKeys.AuthorizationToken);
}
