mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 08:16:39 +02:00
🐛 Fix unexpected internal error on password recovery request.
This commit is contained in:
parent
dfc938b804
commit
3b0ea9b7fd
2 changed files with 9 additions and 8 deletions
|
@ -187,7 +187,6 @@
|
||||||
(db/exec-one! conn [sql:profile-by-email email])))
|
(db/exec-one! conn [sql:profile-by-email email])))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; --- Mutation: Register if not exists
|
;; --- Mutation: Register if not exists
|
||||||
|
|
||||||
(sm/defmutation ::login-or-register
|
(sm/defmutation ::login-or-register
|
||||||
|
@ -433,10 +432,11 @@
|
||||||
:name (:fullname profile)}))]
|
:name (:fullname profile)}))]
|
||||||
|
|
||||||
(db/with-atomic [conn db/pool]
|
(db/with-atomic [conn db/pool]
|
||||||
(let [profile (->> (retrieve-profile-by-email conn email)
|
(some->> email
|
||||||
(create-recovery-token conn))]
|
(retrieve-profile-by-email conn)
|
||||||
(send-email-notification conn profile)
|
(create-recovery-token conn)
|
||||||
nil))))
|
(send-email-notification conn))
|
||||||
|
nil)))
|
||||||
|
|
||||||
|
|
||||||
;; --- Mutation: Recover Profile
|
;; --- Mutation: Recover Profile
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.alpha :as mf]
|
[rumext.alpha :as mf]
|
||||||
[uxbox.main.ui.icons :as i]
|
|
||||||
[uxbox.common.spec :as us]
|
[uxbox.common.spec :as us]
|
||||||
[uxbox.main.data.auth :as uda]
|
[uxbox.main.data.auth :as uda]
|
||||||
[uxbox.main.data.messages :as dm]
|
[uxbox.main.data.messages :as dm]
|
||||||
[uxbox.main.store :as st]
|
[uxbox.main.store :as st]
|
||||||
[uxbox.main.ui.components.forms :refer [input submit-button form]]
|
[uxbox.main.ui.components.forms :refer [input submit-button form]]
|
||||||
|
[uxbox.main.ui.icons :as i]
|
||||||
[uxbox.main.ui.navigation :as nav]
|
[uxbox.main.ui.navigation :as nav]
|
||||||
[uxbox.util.dom :as dom]
|
[uxbox.util.dom :as dom]
|
||||||
[uxbox.util.forms :as fm]
|
[uxbox.util.forms :as fm]
|
||||||
|
@ -29,8 +29,9 @@
|
||||||
|
|
||||||
(defn- on-submit
|
(defn- on-submit
|
||||||
[form event]
|
[form event]
|
||||||
(let [on-success #(st/emit! (dm/info (tr "auth.notifications.recovery-token-sent"))
|
(let [on-success #(st/emit!
|
||||||
(rt/nav :auth-login))
|
(dm/info (tr "auth.notifications.recovery-token-sent"))
|
||||||
|
(rt/nav :auth-login))
|
||||||
params (with-meta (:clean-data form)
|
params (with-meta (:clean-data form)
|
||||||
{:on-success on-success})]
|
{:on-success on-success})]
|
||||||
(st/emit! (uda/request-profile-recovery params))))
|
(st/emit! (uda/request-profile-recovery params))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue