          (assoc context :response (ok response)))))})
 
 (defn- valid-session?
-  [usernames expiration]
-  (and (not (empty? usernames)) (java-time/before? expiration (java-time/instant))))
+  [username expiration]
+  (and (empty? username) (java-time/before? expiration (java-time/instant))))
 
 (defn- extend-session
   [session]

   :leave
   (fn [context]
     (if (ok? context)
       (let [usernames (get-in context [:request :session :usernames])
             new-user (get-in context [:response :body :username])]
         (assoc-in context [:response :session] (extend-session {:usernames (conj usernames new-user)})))
       context))})

(defn logins [handler] [(body-params/body-params)

  {:name :authenticated
   :enter
   (fn [context]
     (let [username (get-in context [:request :session :username])
           expiration (get-in context [:request :session :expiration])]
       (if (valid-session? username expiration)
         (assoc-in context [:request ::params ::username] username)
         unauthenticated)))
   :leave
   (fn [context]
