def METHOD_NAME(request, reason=""):
    if _is_ajax(request):
        return JsonResponse(
            {
                "detail": pgettext(
                    "api",
                    "Your request was rejected because your browser didn't send the CSRF cookie, or the cookie sent was invalid.",
                )
            },
            status=403,
        )
    return render(request, "misago/errorpages/csrf_failure.html", status=403)