Merge pull request #3149 from Safelite/nation/CASH-1545

CASH-1545 check session expiration with JS interval
This commit is contained in:
CarlNation 2026-04-24 04:29:35 -04:00 committed by GitHub
commit b8e336c8a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 1 deletions

View file

@ -15,6 +15,7 @@ const environmentVariables = {
['__VUE_APP_SOLARWINDS_MONITORING_SCRIPT__']: "",
['__VUE_APP_ADYEN_ENVIRONMENT__']: "test",
['__VUE_APP_ADYEN_CLIENT_KEY__']: "test_WYGT4F5ZT5BRRL5MPWHK6QLYOIXZXROD",
['__VUE_APP_SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS__']: 60000,
};
const keysOnly = Object.keys(environmentVariables);

View file

@ -18,6 +18,8 @@ import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
import funnelFooter from "@/fmg-components/funnel-footer/funnel-footer.vue";
import salesforceWebchat from "./digital-components/salesforce-webchat/salesforce-webchat.vue";
import sierraWebchat from "./digital-components/sierra-webchat/sierra-webchat.vue";
import analyticsMixin from "@/mixins/analytics-mixin";
import { applicationConfig } from "@/constants/application-config";
export default {
name: "app",
@ -25,8 +27,18 @@ export default {
const { globalNonpersistedState } = showFmgLoadingModal();
return { globalNonpersistedState };
},
data() {
return {
sessionCheckInterval: null,
};
},
methods: {
handleAnyComponentFocus: handleAnyComponentFocus,
checkSessionAndRedirect() {
if (analyticsMixin.methods.sessionExpired()) {
this.$router.sendToReturnUser();
}
},
},
computed: {
shouldShowLoader() {
@ -44,6 +56,16 @@ export default {
},
mounted() {
showFmgLoadingModal(true);
// Check session expiration and redirect if expired
this.sessionCheckInterval = setInterval(
this.checkSessionAndRedirect,
applicationConfig.SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS
);
},
beforeUnmount() {
if (this.sessionCheckInterval) {
clearInterval(this.sessionCheckInterval);
}
},
};

View file

@ -31,6 +31,8 @@ const applicationConfig = {
AFFILIATE_COOKIE_CONTAINING_NAME: "_Track",
COOKIE_NAME_LENGTH_MAX_LIMIT: 44,
SESSION_TIMEOUT_MINUTES: process.env.__VUE_APP_SESSION_TIMEOUT_MINUTES__,
SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS:
process.env.__VUE_APP_SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS__,
RETURN_USER_PAGE: "/fmg/return-user",
ADYEN_CLIENT_KEY: process.env.__VUE_APP_ADYEN_CLIENT_KEY__,
ADYEN_ENVIRONMENT: process.env.__VUE_APP_ADYEN_ENVIRONMENT__,

View file

@ -6,7 +6,6 @@ export const autoRouteTable = [
routeData.MOLDING_QUESTIONS,
routeData.VEHICLE_PARTS,
routeData.PART_QUESTIONS,
routeData.VIN_LOOKUP,
routeData.ESTIMATE,
routeData.VEHICLE_DAMAGE,
routeData.VEHICLE,