Skip to content

Commit

Permalink
fix(csp): aborts spa navigation before location update
Browse files Browse the repository at this point in the history
To avoid slow updates causing CSP errors because of wrong headers
  • Loading branch information
kelsos committed Aug 2, 2023
1 parent ec65726 commit fb5ff66
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions middleware/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { isClient } from '@vueuse/core';
*/
export default defineNuxtRouteMiddleware((to, from) => {
if (isClient && from.path === '/checkout/payment-method') {
abortNavigation();
window.location.href = to.fullPath;
}
});

0 comments on commit fb5ff66

Please sign in to comment.