mirror of
https://github.com/penpot/penpot.git
synced 2025-05-07 00:25:53 +02:00
🐛 Fix wrong handling of deleted users on password recovery.
This commit is contained in:
parent
7f624b5c61
commit
3d043adb03
1 changed files with 9 additions and 7 deletions
|
@ -13,10 +13,8 @@
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.db.sql :as sql]
|
|
||||||
[app.util.services :as sv]
|
[app.util.services :as sv]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]))
|
||||||
[cuerdas.core :as str]))
|
|
||||||
|
|
||||||
;; --- Helpers & Specs
|
;; --- Helpers & Specs
|
||||||
|
|
||||||
|
@ -97,12 +95,16 @@
|
||||||
|
|
||||||
profile))
|
profile))
|
||||||
|
|
||||||
|
(def sql:retrieve-profile-by-email
|
||||||
|
"select p.* from profile as p
|
||||||
|
where p.email = lower(?)
|
||||||
|
and p.deleted_at is null")
|
||||||
|
|
||||||
(defn retrieve-profile-data-by-email
|
(defn retrieve-profile-data-by-email
|
||||||
[conn email]
|
[conn email]
|
||||||
(let [sql (sql/select :profile {:email (str/lower email)})
|
(let [sql [sql:retrieve-profile-by-email email]]
|
||||||
data (db/exec-one! conn sql)]
|
(some-> (db/exec-one! conn sql)
|
||||||
(when (and data (nil? (:deleted-at data)))
|
(decode-profile-row))))
|
||||||
(decode-profile-row data))))
|
|
||||||
|
|
||||||
;; --- Attrs Helpers
|
;; --- Attrs Helpers
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue