import { CookieStorage } from '@dvn/kimlik/storage/cookie';
import { getRouteParams } from './route';
export function getSessionDetails() {
  const { domain } = getRouteParams(location.pathname);
  const jwt = new CookieStorage().get('mt_at');
  const context = {
    organisationDomain: domain,
    organisationId: new CookieStorage().get('mt_oid'),
    userId: new CookieStorage().get('mt_uid'),
    role: new CookieStorage().get('mt_role'),
  };
  const headers = {
    Client: 'd2ViLWNsaWVu',
  };
  if (jwt) {
    headers['Authorization'] = `Bearer ${jwt}`;
  }
  else {
    headers['Session-Token'] = `NTdiMzY3NjBlNjNiY2UxZWViMDAwMDA0`;
  }
  return { context, headers };
}
