                                 :confirm v/required)))))
 
 (defn do-registration [{{:keys [username
-                             password
-                             confirm
-                             nickname
-                             phone_no] :as params} :params}]
+                                password
+                                confirm
+                                nickname
+                                phone_no] :as params} :params}]
   (if (valid-registration? params)
     (if (= password confirm)
       (register-user! username password nickname phone_no)

(def default-value {:nickname ""
                    :phone_no ""})

(defn register-user! [username password nickname phone_no]
  (when-let [_ (db/create-user! (merge default-value {:username username
                                                      :password (hashers/encrypt password)
                                                      :nickname nickname

    (layout/render "success.html" {:title "Success!"
                                   :description "You have been registered."})))

(defn- valid-registration? [params]
  (b/valid? params
            :username [v/required available-username]
            :password v/required
            :confirm v/required))

(defn- get-registration-error [params]
  (apply str (:username (first (b/validate
                                params
                                :username [v/required available-username]
