/* Xeslint-disable */ import apiUtil from "./gzapi"; import { processLogin, processLogout } from "./authutil"; export default { async authenticate(login, password) { return fetch( apiUtil.APIUrl("auth"), apiUtil.fetchPostNoAuthOptions({ login: login, password: password }) ) .then(apiUtil.status) .then(apiUtil.json) .then(processLogin) .then(() => { return Promise.resolve(true); }) //succeeded, nothing to return .catch(function(error) { processLogout(); return Promise.reject(error); }); }, logout() { processLogout(); } };