all apparently working and cleaned up

This commit is contained in:
2020-06-10 21:40:05 +00:00
parent 0a43e53ab7
commit 3dd7e05549
9 changed files with 12 additions and 985 deletions

View File

@@ -6,7 +6,6 @@ export default {
async authenticate(login, password) {
return new Promise(async function doAuth(resolve, reject) {
try {
console.log("AUTH: TOP");
let fetchData = await fetch(
window.$gz.api.APIUrl("auth"),
window.$gz.api.fetchPostNoAuthOptions({
@@ -14,51 +13,15 @@ export default {
password: password
})
);
console.log("AUTH: status");
fetchData = await window.$gz.api.status(fetchData);
console.log("AUTH: extractBody");
fetchData = await window.$gz.api.extractBody(fetchData);
console.log("AUTH: calling processLogin");
await processLogin(fetchData);
console.log(
"### AUTH:after processlogin completed - resolving done (THIS SHOULD BE LAST)"
);
resolve();
} catch (e) {
reject(e);
}
// .catch(function handleAuthError(error) {
// processLogout();
// return reject(error);
// });
// .then(processLogin)
// .then(() => {
// return resolve(true);
// }) //succeeded, nothing to return
});
},
// async authenticate(login, password) {
// return fetch(
// window.$gz.api.APIUrl("auth"),
// window.$gz.api.fetchPostNoAuthOptions({
// login: login,
// password: password
// })
// )
// .then(window.$gz.api.status)
// .then(window.$gz.api.extractBody)
// .then(processLogin)
// .then(() => {
// console.log("auth:authenticate returning resolved done");
// return Promise.resolve(true);
// }) //succeeded, nothing to return
// .catch(function handleAuthError(error) {
// processLogout();
// return Promise.reject(error);
// });
// },
logout() {
processLogout();
}