             [clojail.core             :only [thunk-timeout]]
             [clojure.stacktrace       :only [print-cause-trace]]
             [somnium.congomongo       :only [update! fetch-one]]))
+
+(def password-reset-url "https://www.4clojure.com/settings")
 
 (def login-box
   (form-to [:post "/login"]

                                            :only [:_id :user])]
    (let [{:keys [success] :as diagnostics} (try-to-email email name id)]
      (if success
        (do (session/session-put! :login-to "/login/update")
            (flash-msg (login-url "/login/update")
              "Your password has been reset! You should receive an email soon."))
        (do (spit (str name ".pwd") diagnostics)
            (flash-error "/login/reset"

           :text
           (str "The password for your 4clojure.com account "
                name " has been reset to " pw ". Make sure to change it"
                " soon at " password-reset-url " - pick"
                " something you'll remember!")})
         {:success true})
       10 :sec)
