moved security.

This commit is contained in:
Bryce Covert
2018-04-06 09:20:51 -07:00
parent b93808f1df
commit c74e4fceaa
7 changed files with 100 additions and 90 deletions

View File

@@ -0,0 +1,9 @@
(ns auto-ap.routes.utils
(:require [buddy.auth :refer [authenticated?]]))
(defn wrap-secure [handler]
(fn [request]
(if (authenticated? request)
(handler request)
{:status 401
:body "not authenticated"})))