       {:status 200
        :body (if boilerplate (boilerplate (html form)) (html [:body form]))})))
 
-(defn new-login-post-handler [handlers-p get-handler-key {:keys [user-authenticator http-session-store] :as opts}]
+(defn new-login-post-handler [handlers-p & {:keys [user-authenticator http-session-store] :as opts}]
   (s/validate {:user-authenticator (s/protocol UserAuthenticator)
                :http-session-store (s/protocol HttpSessionStore)}
               opts)

;; Since this module is dependent on bidi, let's provide some sample
;; bidi routes that can be used as-is or to demonstrate.

(defn new-login-get-handler [handlers-p post-handler-key {:keys [boilerplate] :as opts}]
  (fn [{{{requested-uri :value} "requested-uri"} :cookies
        routes :modular.bidi/routes}]
    (let [form
          [:form {:method "POST" :style "border: 1px dotted #555"
                  :action (bidi/path-for routes (get @handlers-p post-handler-key))}
           (when requested-uri
             [:input {:type "hidden" :name :requested-uri :value requested-uri}])
           [:div

  (context [this] context))

(def new-login-form-schema
  {(s/optional-key :context) s/Str
   (s/optional-key :boilerplate) (s/=> 1)})

(defn new-login-form [& {:as opts}]
  (let [{:keys [context boilerplate]}
        (->> opts
             (merge {:context ""
                     :boilerplate #(html [:body %])})
             (s/validate new-login-form-schema))]
    (component/using (->LoginForm context boilerplate) [:user-authenticator :http-session-store])))

;; Now we can build a protection system, composed of a login form, user
;; authenticator and session store. Different constructors can build this
