This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export default {
|
||||
version: "8.0.0-alpha.3",
|
||||
version: "8.0.0-alpha.4",
|
||||
copyright:
|
||||
"Copyright © 1999-2019, Ground Zero Tech-Works Inc. All Rights Reserved"
|
||||
};
|
||||
|
||||
@@ -13,17 +13,7 @@ export default {
|
||||
)
|
||||
.then(apiUtil.status)
|
||||
.then(apiUtil.json)
|
||||
.then(result => {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("auth.js about to process login...");
|
||||
return result;
|
||||
})
|
||||
.then(processLogin)
|
||||
.then(result => {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("auth.js returned from process login, resolving next");
|
||||
return result;
|
||||
})
|
||||
.then(() => {
|
||||
return Promise.resolve(true);
|
||||
}) //succeeded, nothing to return
|
||||
|
||||
@@ -43,9 +43,6 @@ export function processLogin(response) {
|
||||
roles: token["ayanova/roles"]
|
||||
});
|
||||
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 2 - PROCESS LOGIN - CALLING INITIALIZE");
|
||||
|
||||
//Initialize the application
|
||||
initialize().then(() => {
|
||||
store.commit(
|
||||
|
||||
@@ -17,17 +17,11 @@ function addNavItem(title, icon, route) {
|
||||
// on change of authentication status
|
||||
export default function initialize() {
|
||||
var promise = new Promise(function(resolve) {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 3 - INITIALIZE TOP");
|
||||
if (store.state.authenticated) {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 4 - INITIALIZE FETCHING LOCALE KEYS");
|
||||
//Fetch the core localized text keys that will always be required by user
|
||||
locale
|
||||
.fetch(locale.coreKeys)
|
||||
.then(function putFetchedNavItemsInStore() {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 5 - DONE FETCHING LOCALE KEYS CREATING NAV ITEMS");
|
||||
//put nav items into store
|
||||
//Everyone has a home
|
||||
addNavItem(locale.get("Home"), "home", "/");
|
||||
@@ -83,10 +77,6 @@ export default function initialize() {
|
||||
// addNavItem(locale.get("Logout"), "sign-out-alt", "/login");
|
||||
})
|
||||
.then(() => {
|
||||
/* eslint-disable-next-line */
|
||||
console.log(
|
||||
"STEP 6 - INIT DONE WITH NAV, NOW FETCHING USEROPTIONS SETTINGS"
|
||||
);
|
||||
//CACHE LOCALE SETTINGS
|
||||
api
|
||||
.get("UserOptions/" + store.state.userId)
|
||||
@@ -116,8 +106,7 @@ export default function initialize() {
|
||||
|
||||
//Store offset in locale data
|
||||
locale.timeZoneOffset = res.data.timeZoneOffset;
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 7 - DONE FETCHING LOCALE SETTINGS");
|
||||
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,9 +12,6 @@ export default {
|
||||
return store.state.localeText[key];
|
||||
},
|
||||
fetch(keys) {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("LOCALE - TOP OF FETCH(KEYS)");
|
||||
|
||||
return new Promise(function fetchLocaleKeysFromServer(resolve) {
|
||||
//, reject
|
||||
//step 1: build an array of keys that we don't have already
|
||||
@@ -39,11 +36,6 @@ export default {
|
||||
_.forEach(response.data, function commitFetchedLTItemToStore(item) {
|
||||
store.commit("addLocaleText", item);
|
||||
});
|
||||
/* eslint-disable-next-line */
|
||||
console.log(
|
||||
"LOCALE - DONE FETCH(KEYS) and stored about to call Resolve()..."
|
||||
);
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -76,13 +76,9 @@ export default {
|
||||
if (this.input.username != "" && this.input.password != "") {
|
||||
this.errorBadCreds = false;
|
||||
var that = this;
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 1 - LOGIN::AUTHENTICATING");
|
||||
auth
|
||||
.authenticate(this.input.username, this.input.password)
|
||||
.then(() => {
|
||||
/* eslint-disable-next-line */
|
||||
console.log("STEP 8 - LOGIN::AUTHENTICATE COMPLETED - GOING HOME");
|
||||
this.$router.push({ name: "home" });
|
||||
})
|
||||
.catch(function handleCaughtLoginError(error) {
|
||||
|
||||
Reference in New Issue
Block a user