 (def authdata {:admin "pw"
                :test "pw"})
 
-(defn unauthorized-handler
-  [request metadata]
+(defn unauthorized-handler [request metadata]
   ;; If request is authenticated, raise 403 instead
   ;; of 401 (because user is authenticated but permission
   ;; denied is raised).

(def auth-backend
  (session-backend {:unauthorized-handler unauthorized-handler}))

(defn home
  [req]
  (when (not (authenticated? req))
    (throw-unauthorized {:message "Not authorized"}))
  (render-file "templates/index.html" {:dev (env :dev?)}))

            [buddy.auth.backends.session :refer [session-backend]]
            [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]

            [buddy.hashers :as hashers]))

(def uri "datomic:dev://localhost:4334/movement8")
(def conn (d/connect uri))
