aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/middleware.clj
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2018-02-17 13:55:55 -0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2018-02-17 13:55:55 -0200
commit98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa (patch)
tree61f453e1b21634e0f2d740ff61091d182e145184 /src/clj/queue_api/middleware.clj
downloadqueue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.tar.gz
queue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.tar.bz2
queue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.zip
Initial commit
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)))))