                             (fix-user-for-liberator)
                             (assoc :authenticated (not (nil? auth/*user*))))})))
 
-(defn- current-user-id [conn]
-  (let [id (:user/id (user/get-by-subject conn (:sub auth/*user*)))]
+(defn- current-user-id []
+  (let [id (:user/id auth/*user*)]
     (assert id)
     id))
 

      (assert (not (str/blank? name)) ; TODO: test this
              {:name name})
      (db/with-db [conn {}]
        (let [user-id (current-user-id conn)]
          (binding [events/*current-user* user-id]
            (let [cong-id (congregation/create-congregation! conn name)]
              (congregation/grant! conn cong-id user-id :view-congregation)

(defn list-congregations [request]
  (auth/with-authenticated-user request
    (require-logged-in!)
    (ok (->> (congregation/get-my-congregations (projections/cached-state) (current-user-id))
             (map (fn [congregation]
                    {:id (:congregation/id congregation)
                     :name (:congregation/name congregation)}))))))

(def ^:private format-key-for-api (memoize (comp csk/->camelCaseString name)))

