   (stop [this] this)
 
   UserAuthenticator
-  (allowed-user? [this uid pw]
+  (authenticate-user [this uid pw]
     (when-let [hash (get-hash-for-uid (:password-store this) uid)]
       (verify-password pw hash)
       ;; TODO There is a slight security concern here. If no uid is


(defrecord MapBackedUserRegistry [m]
  UserAuthenticator
  (allowed-user? [_ user password]
    ((set (seq m)) [user password])))

(defn new-map-backed-user-registry [m]


    (if (and username
             (not-empty username)
             (authenticate-user user-authenticator (.trim username) password))

      {:status 302
       :headers {"Location" (or requested-uri "/")} ; "/" can be parameterized (TODO)
