This commit is contained in:
@@ -407,44 +407,17 @@ export default {
|
||||
// throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
}
|
||||
await processLogin(res.data, loggedInWithKnownPassword);
|
||||
|
||||
//check if support and updates has expired and is paid for license and show warning if so
|
||||
if (
|
||||
vm.$store.state.globalSettings.maintenanceExpired &&
|
||||
(vm.$store.state.globalSettings.licenseStatus == 3 ||
|
||||
vm.$store.state.globalSettings.licenseStatus == 4)
|
||||
) {
|
||||
(async function() {
|
||||
await window.$gz.dialog.displayLTModalNotificationMessage(
|
||||
"MaintenanceExpiredNote",
|
||||
"MaintenanceExpired",
|
||||
"error",
|
||||
"https://www.ayanova.com/subscriptionexpired.htm"
|
||||
);
|
||||
})();
|
||||
//check for 2fa enabled, if so then need to do one more step before process login can be called
|
||||
if (res.data.tfa) {
|
||||
//prompt for 2fa
|
||||
|
||||
//send 2fa code to server if ok, then proceed as normal
|
||||
|
||||
await this.step2(res, loggedInWithKnownPassword);
|
||||
}
|
||||
|
||||
let toPath = vm.$route.params.topath; //set in app.vue::mounted
|
||||
if (toPath != undefined) {
|
||||
//check if it's an open report link and if so
|
||||
//trigger that to open in a new window and continue on to normal home page
|
||||
if (toPath.startsWith("/viewreport")) {
|
||||
(async function() {
|
||||
//open report links have a query string /viewreport?oid=[objectid]&rid=[reportid]
|
||||
let searchParams = new URLSearchParams(vm.$route.params.search);
|
||||
let objectId = parseInt(searchParams.get("oid"));
|
||||
let reportId = parseInt(searchParams.get("rid"));
|
||||
await window.$gz.api.renderReport(objectId, reportId); //objectid,reportid
|
||||
})();
|
||||
vm.$router.push(vm.$store.state.homePage);
|
||||
} else {
|
||||
//otherwise open the url indicated
|
||||
vm.$router.push(vm.$route.params.topath);
|
||||
}
|
||||
} else {
|
||||
vm.$router.push(vm.$store.state.homePage);
|
||||
}
|
||||
await this.step2(res, loggedInWithKnownPassword);
|
||||
} catch (error) {
|
||||
//bad creds?
|
||||
if (
|
||||
@@ -479,6 +452,47 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async step2(res, loggedInWithKnownPassword) {
|
||||
let vm = this;
|
||||
await processLogin(res.data, loggedInWithKnownPassword);
|
||||
|
||||
//check if support and updates has expired and is paid for license and show warning if so
|
||||
if (
|
||||
vm.$store.state.globalSettings.maintenanceExpired &&
|
||||
(vm.$store.state.globalSettings.licenseStatus == 3 ||
|
||||
vm.$store.state.globalSettings.licenseStatus == 4)
|
||||
) {
|
||||
(async function() {
|
||||
await window.$gz.dialog.displayLTModalNotificationMessage(
|
||||
"MaintenanceExpiredNote",
|
||||
"MaintenanceExpired",
|
||||
"error",
|
||||
"https://www.ayanova.com/subscriptionexpired.htm"
|
||||
);
|
||||
})();
|
||||
}
|
||||
|
||||
let toPath = vm.$route.params.topath; //set in app.vue::mounted
|
||||
if (toPath != undefined) {
|
||||
//check if it's an open report link and if so
|
||||
//trigger that to open in a new window and continue on to normal home page
|
||||
if (toPath.startsWith("/viewreport")) {
|
||||
(async function() {
|
||||
//open report links have a query string /viewreport?oid=[objectid]&rid=[reportid]
|
||||
let searchParams = new URLSearchParams(vm.$route.params.search);
|
||||
let objectId = parseInt(searchParams.get("oid"));
|
||||
let reportId = parseInt(searchParams.get("rid"));
|
||||
await window.$gz.api.renderReport(objectId, reportId); //objectid,reportid
|
||||
})();
|
||||
vm.$router.push(vm.$store.state.homePage);
|
||||
} else {
|
||||
//otherwise open the url indicated
|
||||
vm.$router.push(vm.$route.params.topath);
|
||||
}
|
||||
} else {
|
||||
vm.$router.push(vm.$store.state.homePage);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
|
||||
Reference in New Issue
Block a user