         (api request)
         (site request)))))
 
+(defn handle-anti-forgery-error [req]
+  (log/warn "ANTI_FORGERY_ERROR - headers: " (:headers req))
+  (html-response (error/internal-server-error default-context)))
+
 (def wrap-defaults-config
   (-> site-defaults
-      (assoc-in [:session :cookie-attrs :max-age] 3600)))
+      (assoc-in [:session :cookie-attrs :max-age] 3600)
+      (assoc-in [:security :anti-forgery] {:error-handler handle-anti-forgery-error})))
 
 (defn create-site-app [dev-mode?]
   (-> (scenic-handler routes site-handlers not-found)

    (log/info (str "TEST USER DETAILS:" user))
    (log/info (str "TEST CLIENT DETAILS:" client-details))))

(def lein-app (create-app true))

            [stonecutter.translation :as t]
            [stonecutter.middleware :as m]))

(def default-context {:translator (t/translations-fn t/translation-map)})

(defn not-found [request]
  (-> (html-response (error/not-found-error default-context))
      (r/status 404)))

(def site-handlers
  {:home                   user/home
