     (with-account
      (profile-form account)))
   (POST "/profile" {session :session params :params}
-    (with-account 
+    (with-account
       (update-profile account params)))
   (GET "/login" {params :params}
     (login-form))


(defmacro with-account [body]
  `(if-let [~'account (~'session :account)]
     (do ~body)
     (redirect "/login")))

(defmacro try-account [body]
  `(let [~'account (~'session :account)]
     (do ~body)))

(defroutes main-routes
  (GET "/search" {session :session params :params}

  (ANY "*" {session :session}
    (html-doc (session :account) "Page not found" (not-found-doc))))

(def clojars-app
   (-> main-routes
       wrap-session
       (wrap-file "public")
       db-middleware))

(comment
  (require 'swank.swank)
  (swank.swank/start-repl)

  (with-db (find-jar "leiningen"))
  (def server (run-server {:port 8000} "/*" (servlet clojars-app)))
  (.stop server))
