Prevent actions that will fail because of CSRF

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:

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