We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Keys can be added to the request map to pass additonal information to the handler and other middleware.
Here is an example that adds a :user key to the request, if there is a user ID in the session.
:user
(defn wrap-user [handler] (fn [request] (if-let [user-id (-> request :session :user-id)] (let [user (get-user-by-id user-id)] (handler (assoc request :user user)) (handler request))))
The get-user-by-id function will depend on how the application is stores user information.
get-user-by-id