This commit is contained in:
@@ -47,10 +47,21 @@ CURRENT TODOs
|
|||||||
|
|
||||||
|
|
||||||
TODO: AUTO-LOGOUT EXPIRED SESSION?
|
TODO: AUTO-LOGOUT EXPIRED SESSION?
|
||||||
- first off, is this really an issue?
|
- planning:
|
||||||
- Right now a user can simply close the browser in the middle of a session, re-open it any amount of time later and it will just keep working, however it might have outdatd cached data from the server
|
- first off, is this really an issue?
|
||||||
- What about a time limit after which a session needs to login again just to protect the users from themselves?
|
- No, actually it's kind of useful for keeping on working when a server needs a restart or something
|
||||||
- Perhaps it can detect a full page refresh (which is what a restart essentially is) and see how long ago it was last active, maybe the time of the last API call to the server and use that info to force re-login.
|
- Only real issue is cached data mismatch so perhaps when detected it should toss cached data forcing a reload
|
||||||
|
- Or is this really an issue either? things cached are form customization and locale text which in the normal course of things won't change much
|
||||||
|
|
||||||
|
- Right now a user can simply close the browser in the middle of a session, re-open it any amount of time later and it will just keep working, however it might have outdatd cached data from the server
|
||||||
|
- What about a time limit after which a session needs to login again just to protect the users from themselves?
|
||||||
|
- Perhaps it can detect a full page refresh (which is what a restart essentially is) and see how long ago it was last active, maybe the time of the last API call to the server and use that info to force re-login.
|
||||||
|
- ACTION:
|
||||||
|
- add code to reliably detect when a user opens the browser or reloads with a session active
|
||||||
|
- Add code to track last active
|
||||||
|
- User interacted with server sb good enough
|
||||||
|
- toss any cached data if it's been more than an hour since the session was last active
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ export default {
|
|||||||
if (!this.$store.state.authenticated) {
|
if (!this.$store.state.authenticated) {
|
||||||
this.$router.push({ name: "login" });
|
this.$router.push({ name: "login" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FUTURE: If need to detect a reload, this works reliably
|
||||||
|
//OK if here then is this a reliable way to detect a reload or refresh or re-open of the app from a closed window but still authenticated?
|
||||||
|
//console.log("APP.VUE::Mounted=>RELOAD DETECTED?");
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isAuthenticated() {
|
isAuthenticated() {
|
||||||
|
|||||||
@@ -83,6 +83,10 @@ function handleError(action, error, route, reject) {
|
|||||||
error.message.includes("Network request failed")
|
error.message.includes("Network request failed")
|
||||||
) {
|
) {
|
||||||
window.$gz.store.commit("logItem", "Network error");
|
window.$gz.store.commit("logItem", "Network error");
|
||||||
|
window.$gz.eventBus.$emit(
|
||||||
|
"notify-error",
|
||||||
|
window.$gz.locale.get("ErrorServerUnresponsive")
|
||||||
|
);
|
||||||
//note: using locale key in square brackets
|
//note: using locale key in square brackets
|
||||||
return reject("[ErrorServerUnresponsive]");
|
return reject("[ErrorServerUnresponsive]");
|
||||||
//throw "Error: unable to contact server";
|
//throw "Error: unable to contact server";
|
||||||
|
|||||||
Reference in New Issue
Block a user