aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/middleware.clj
blob: 6d1ea43b4e2c80110f23982a0c0a0af8b04e3467 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(ns queue-api.middleware
  (:require [queue-api.env :refer [defaults]]
            [queue-api.config :refer [env]]
            [ring.middleware.flash :refer [wrap-flash]]
            [immutant.web.middleware :refer [wrap-session]]
            [ring.middleware.defaults :refer [site-defaults wrap-defaults]]))

(defn wrap-base [handler]
  (-> ((:middleware defaults) handler)
      wrap-flash
      (wrap-session {:cookie-attrs {:http-only true}})
      (wrap-defaults
        (-> site-defaults
            (assoc-in [:security :anti-forgery] false)
            (dissoc :session)))))