diff --git a/frontend/src/app/main/ui/auth/register.cljs b/frontend/src/app/main/ui/auth/register.cljs index cda4f878d..0c1a0e70c 100644 --- a/frontend/src/app/main/ui/auth/register.cljs +++ b/frontend/src/app/main/ui/auth/register.cljs @@ -58,33 +58,33 @@ :opt-un [::invitation-token])) (defn- handle-prepare-register-error - [form {:keys [type code] :as cause}] - (condp = [type code] - [:restriction :registration-disabled] - (st/emit! (msg/error (tr "errors.registration-disabled"))) + [form cause] + (let [{:keys [type code]} (ex-data cause)] + (condp = [type code] + [:restriction :registration-disabled] + (st/emit! (msg/error (tr "errors.registration-disabled"))) - [:restriction :profile-blocked] - (st/emit! (msg/error (tr "errors.profile-blocked"))) + [:restriction :profile-blocked] + (st/emit! (msg/error (tr "errors.profile-blocked"))) - [:validation :email-has-permanent-bounces] - (let [email (get @form [:data :email])] - (st/emit! (msg/error (tr "errors.email-has-permanent-bounces" email)))) + [:validation :email-has-permanent-bounces] + (let [email (get @form [:data :email])] + (st/emit! (msg/error (tr "errors.email-has-permanent-bounces" email)))) - [:validation :email-already-exists] - (swap! form assoc-in [:errors :email] - {:message "errors.email-already-exists"}) + [:validation :email-already-exists] + (swap! form assoc-in [:errors :email] + {:message "errors.email-already-exists"}) - [:validation :email-as-password] - (swap! form assoc-in [:errors :password] - {:message "errors.email-as-password"}) + [:validation :email-as-password] + (swap! form assoc-in [:errors :password] + {:message "errors.email-as-password"}) - (st/emit! (msg/error (tr "errors.generic"))))) + (st/emit! (msg/error (tr "errors.generic")))))) (defn- handle-prepare-register-success [params] (st/emit! (rt/nav :auth-register-validate {} params))) - (mf/defc register-form [{:keys [params on-success-callback] :as props}] (let [initial (mf/use-memo (mf/deps params) (constantly params))