     (and (:user session) (:access_token session))))
 
 (defn redirect-to-authorisation [return-to user client-id]
-  (if-let [client (client/fetch-client client-id)]
-    (assoc (r/redirect return-to) :session {:user user :access_token (:token (token/create-token client user))})
+  (if-let [client (cl-client/fetch-client client-id)]
+    (assoc (r/redirect return-to) :session {:user user :access_token (:token (cl-token/create-token client user))})
     (throw (Exception. "Invalid client"))))
 
 (defn register-user [request]

    (redirect-to-profile-deleted)))

(defn redirect-to-profile [user]
  (assoc (r/redirect (path :show-profile)) :session {:user user
                                                     :access_token (:token (token/create-token nil user))}))

(defn redirect-to-profile-created [user]
  (assoc (r/redirect (path :show-profile-created)) :session {:user user
                                                             :access_token (:token (token/create-token nil user))}))

(defn redirect-to-profile-deleted []
  (assoc (r/redirect (path :show-profile-deleted)) :session nil))

(defn show-registration-form [request]
  (html-response (register/registration-form request)))

(defn preserve-session [response request]
  (-> response

    (if (empty? err)
      (-> (s/store-user! email password)
          redirect-to-profile-created)
      (sh/html-response (register/registration-form request)))))

(defn sign-in [request]
  (let [client-id (get-in request [:session :client-id])
