mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 14:36:42 +02:00
🐛 Fix error handling on register page
This commit is contained in:
parent
8cb550120a
commit
5b722a8608
1 changed files with 17 additions and 17 deletions
|
@ -58,7 +58,8 @@
|
|||
:opt-un [::invitation-token]))
|
||||
|
||||
(defn- handle-prepare-register-error
|
||||
[form {:keys [type code] :as cause}]
|
||||
[form cause]
|
||||
(let [{:keys [type code]} (ex-data cause)]
|
||||
(condp = [type code]
|
||||
[:restriction :registration-disabled]
|
||||
(st/emit! (msg/error (tr "errors.registration-disabled")))
|
||||
|
@ -78,13 +79,12 @@
|
|||
(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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue