Fix csrf error by regenerating csrf token.