feat: disable scripts on password reset page (#9693)

This commit is contained in:
Shivam Mishra
2024-07-01 11:11:57 +05:30
committed by GitHub
parent 46621b0983
commit 5520bf68f3
2 changed files with 19 additions and 5 deletions

View File

@@ -6,12 +6,16 @@ import { validateRouteAccess } from '../helpers/RouteHelper';
export const router = new VueRouter({ mode: 'history', routes });
const sensitiveRouteNames = ['auth_password_edit'];
export const initalizeRouter = () => {
router.beforeEach((to, _, next) => {
AnalyticsHelper.page(to.name || '', {
path: to.path,
name: to.name,
});
if (!sensitiveRouteNames.includes(to.name)) {
AnalyticsHelper.page(to.name || '', {
path: to.path,
name: to.name,
});
}
return validateRouteAccess(to, next, window.chatwootConfig);
});