# Prevent actions that will fail because of CSRF

**URL:** <https://forum.mautic.org/t/prevent-actions-that-will-fail-because-of-csrf/33666>\
**Category:** Ideas and Feature Requests\
**Created:** [October 1, 2024, 6:51am UTC](https://forum.mautic.org/t/prevent-actions-that-will-fail-because-of-csrf/33666 "2024-10-01T06:51:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [October 1, 2024, 6:51am UTC](https://forum.mautic.org/t/prevent-actions-that-will-fail-because-of-csrf/33666/1 "2024-10-01T06:51:16Z")

</div>

My idea is: to prevent the user from carrying an action that will not be successful.

Something that happens to me quite often, as I tend to leave my session open while away, is this: I’m on the emails list page:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/21e414ad08929fb42cedb2a080baeea8c6a94762.png)

I click on an upcoming email, use the builder to make changes and later, when I hit save I get the invalid CSRF token… which means all of my changes are lost.

I understand that avoiding the CSRF error in the first place is complicated, if possible or even desirable, but from a UX perspective, it’s really frustrating, so I believe a second best option would be to raise the red flag earlier on.

I think these groups of people would benefit from this idea: campaign editors.

Why I think they would benefit from this idea: they’d save time in re-work

Are you willing to work on this idea?: I wouldn’t know where to start or when I could sit down to do it.

What skills and resources do you need to explore this further? I think I have everything I need
