CASH-144
CASH-144 checking expired session and routing to return user from the validateSession function in analytics does not prevent the forward click. So move the expiration check and routing to the forward and back buttons and skip the emit click when expired.
This commit is contained in:
parent
bbfe654227
commit
e7fee44398
3 changed files with 45 additions and 13 deletions
|
|
@ -45,6 +45,9 @@
|
|||
<script>
|
||||
import textLink from "@/ux-components/text-link/text-link";
|
||||
import buttonMain from "@/ux-components/button-main/button-main";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import analyticsMixin from "@/mixins/analytics-mixin";
|
||||
import router from "@/router/index.js";
|
||||
|
||||
export default {
|
||||
name: "navbar",
|
||||
|
|
@ -97,7 +100,17 @@ export default {
|
|||
this.$emit("ForwardClicked");
|
||||
},
|
||||
linkClick() {
|
||||
this.$emit("BackClicked");
|
||||
// check session expired and initSession to recreate cookies
|
||||
if (analyticsMixin.methods.sessionExpired()) {
|
||||
analyticsMixin.methods.initSession();
|
||||
|
||||
router.push({
|
||||
path: "/",
|
||||
query: { fmgPage: fmgPageValues.RETURN_USER },
|
||||
});
|
||||
} else {
|
||||
this.$emit("BackClicked");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -712,11 +712,8 @@ export default {
|
|||
return !areAllSessionCookiesSet();
|
||||
},
|
||||
|
||||
async validateSession() {
|
||||
// The noSession function checks the cookies related to analytics logging(sid). it is not the funnel info cookie.
|
||||
// The sid cookie for analytics will expire every 30 minutes and get recreated in initSession. If this happens
|
||||
// and we also have the funnel cookie present, that indicates they have an existing session that is now expired
|
||||
// so route them to the return user page.
|
||||
// sessionExpired is true when one of the analytics cookies(sid, dxdev) has expired but we still have the funnelSessionInfo cookie
|
||||
sessionExpired() {
|
||||
const fromHeritage = getQuerystringParameter(queryStrings.FROM_HERITAGE) === "true";
|
||||
const funnelCookieLastTouched = getFunnelCookie()?.LastTouched;
|
||||
if (
|
||||
|
|
@ -725,11 +722,15 @@ export default {
|
|||
funnelCookieLastTouched !== null &&
|
||||
funnelCookieLastTouched !== undefined
|
||||
) {
|
||||
await this.initSession();
|
||||
router.push({
|
||||
path: "/",
|
||||
query: { fmgPage: fmgPageValues.RETURN_USER },
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
async validateSession() {
|
||||
// do not init session if it is expired. let the click event on button-main handle session expired logic
|
||||
if (this.sessionExpired()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
<script>
|
||||
import loader from "@/ux-components/loader/loader";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import analyticsMixin from "@/mixins/analytics-mixin";
|
||||
import router from "@/router/index.js";
|
||||
|
||||
|
||||
export default {
|
||||
name: "buttonMain",
|
||||
|
|
@ -46,9 +50,23 @@ export default {
|
|||
this.buttonText,
|
||||
true
|
||||
);
|
||||
|
||||
if (!this.isDisabled) {
|
||||
if (!this.suppressLoader) this.isLoaderDisplayed = true;
|
||||
this.$emit("click-event");
|
||||
if (!this.suppressLoader) {
|
||||
this.isLoaderDisplayed = true;
|
||||
}
|
||||
|
||||
// check session expired and initSession to recreate cookies
|
||||
if (analyticsMixin.methods.sessionExpired()) {
|
||||
analyticsMixin.methods.initSession();
|
||||
|
||||
router.push({
|
||||
path: "/",
|
||||
query: { fmgPage: fmgPageValues.RETURN_USER },
|
||||
});
|
||||
} else {
|
||||
this.$emit("click-event");
|
||||
}
|
||||
}
|
||||
},
|
||||
resetButtonStyle() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue