Forbidden (CSRF token from POST incorrect.): /accounts/login/

Seems impossible to prevent this error on at least 1-2 user per day.
When users have many tabs open some are timed out and when next day (or days later) they happen to go back to one of their old browser tab the page often immediately refresh and they get this error.
Can’t find a way to redirect them to login page instead displaying the error :unamused:
All user get forced logout every day at 1AM, there is a small js script in the base.html what check if user is authenticated and redirect to login page however inactive tabs on mobile device don’t run the js script so kinda pointless.Any suggestion how to catch this error and redirect login ?
I have currently custom 400’s 500’s error pages but the CSRF error still not included and it’s just looks awkward every morning when I need to explain IT professional’s that nothing wrong just dummy users keep refreshing an error display page instead of closing it and open a new :rage:

See CSRF_FAILURE_VIEW. You might be able to set this to return a redirect to the login page.