aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/middleware.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clj/queue_api/middleware.clj')
-rw-r--r--src/clj/queue_api/middleware.clj15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/clj/queue_api/middleware.clj b/src/clj/queue_api/middleware.clj
new file mode 100644
index 0000000..6d1ea43
--- /dev/null
+++ b/src/clj/queue_api/middleware.clj
@@ -0,0 +1,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)))))