import { APIBase } from '@dvn/core/api/apiBase';
export const STORAGE_KEY_KIMLIK_USER_ID = 'kimlik_uid';
export const STORAGE_KEY_KIMLIK_TOKEN = 'kimlik_token';
export class KimlikApiImpl {
  constructor(endpoint, defaultHeaders = {}) {
    this.register = (email, firstName, lastName, password) => this.api.post('register', { email, firstName, lastName, password });
    this.login = (email, password) => this.api.post('login', { email, password });
    this.activateUser = (email, firstName, lastName, password) => this.api.post('', // 'activate/email',
    { email, firstName, lastName, password });
    this.logout = () => this.api.post('logout', {});
    this.addAuthInterceptor = (token) => {
      this.api.addAuthInterceptor(token);
    };
    this.getSession = () => this.api.get('session');
    this.api = new APIBase(endpoint, defaultHeaders);
  }
}
