mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -05:00
Merge pull request #2026 from penpot/niwinz-hotfix-20220623
Minor fixes
This commit is contained in:
commit
b0c0c6ed43
4 changed files with 14 additions and 10 deletions
|
@ -51,7 +51,7 @@
|
||||||
(defn profile->props
|
(defn profile->props
|
||||||
[profile]
|
[profile]
|
||||||
(-> profile
|
(-> profile
|
||||||
(select-keys [:is-active :is-muted :auth-backend :email :default-team-id :default-project-id :fullname :lang])
|
(select-keys [:id :is-active :is-muted :auth-backend :email :default-team-id :default-project-id :fullname :lang])
|
||||||
(merge (:props profile))
|
(merge (:props profile))
|
||||||
(d/without-nils)))
|
(d/without-nils)))
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
(ns app.rpc
|
(ns app.rpc
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
|
||||||
[app.common.exceptions :as ex]
|
[app.common.exceptions :as ex]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
|
@ -132,10 +131,13 @@
|
||||||
(fn [result _]
|
(fn [result _]
|
||||||
(when result
|
(when result
|
||||||
(let [resultm (meta result)
|
(let [resultm (meta result)
|
||||||
profile-id (or (:profile-id params)
|
profile-id (or (::audit/profile-id resultm)
|
||||||
(:profile-id result)
|
(:profile-id result)
|
||||||
(::audit/profile-id resultm))
|
(:profile-id params))
|
||||||
props (d/merge params (::audit/props resultm))]
|
props (or (::audit/replace-props resultm)
|
||||||
|
(-> params
|
||||||
|
(merge (::audit/props resultm))
|
||||||
|
(dissoc :type)))]
|
||||||
(audit :cmd :submit
|
(audit :cmd :submit
|
||||||
:type (or (::audit/type resultm)
|
:type (or (::audit/type resultm)
|
||||||
(::type cfg))
|
(::type cfg))
|
||||||
|
|
|
@ -137,7 +137,8 @@
|
||||||
:exp (dt/in-future "48h")}
|
:exp (dt/in-future "48h")}
|
||||||
|
|
||||||
token (tokens :generate params)]
|
token (tokens :generate params)]
|
||||||
{:token token}))
|
(with-meta {:token token}
|
||||||
|
{::audit/profile-id uuid/zero})))
|
||||||
|
|
||||||
;; --- MUTATION: Register Profile
|
;; --- MUTATION: Register Profile
|
||||||
|
|
||||||
|
@ -175,7 +176,7 @@
|
||||||
resp {:invitation-token token}]
|
resp {:invitation-token token}]
|
||||||
(with-meta resp
|
(with-meta resp
|
||||||
{:transform-response ((:create session) (:id profile))
|
{:transform-response ((:create session) (:id profile))
|
||||||
::audit/props (audit/profile->props profile)
|
::audit/replace-props (audit/profile->props profile)
|
||||||
::audit/profile-id (:id profile)}))
|
::audit/profile-id (:id profile)}))
|
||||||
|
|
||||||
;; If auth backend is different from "penpot" means user is
|
;; If auth backend is different from "penpot" means user is
|
||||||
|
@ -184,7 +185,7 @@
|
||||||
(not= "penpot" (:auth-backend profile))
|
(not= "penpot" (:auth-backend profile))
|
||||||
(with-meta (profile/strip-private-attrs profile)
|
(with-meta (profile/strip-private-attrs profile)
|
||||||
{:transform-response ((:create session) (:id profile))
|
{:transform-response ((:create session) (:id profile))
|
||||||
::audit/props (audit/profile->props profile)
|
::audit/replace-props (audit/profile->props profile)
|
||||||
::audit/profile-id (:id profile)})
|
::audit/profile-id (:id profile)})
|
||||||
|
|
||||||
;; If the `:enable-insecure-register` flag is set, we proceed
|
;; If the `:enable-insecure-register` flag is set, we proceed
|
||||||
|
@ -192,7 +193,7 @@
|
||||||
(true? is-active)
|
(true? is-active)
|
||||||
(with-meta (profile/strip-private-attrs profile)
|
(with-meta (profile/strip-private-attrs profile)
|
||||||
{:transform-response ((:create session) (:id profile))
|
{:transform-response ((:create session) (:id profile))
|
||||||
::audit/props (audit/profile->props profile)
|
::audit/replace-props (audit/profile->props profile)
|
||||||
::audit/profile-id (:id profile)})
|
::audit/profile-id (:id profile)})
|
||||||
|
|
||||||
;; In all other cases, send a verification email.
|
;; In all other cases, send a verification email.
|
||||||
|
@ -214,7 +215,7 @@
|
||||||
:extra-data ptoken})
|
:extra-data ptoken})
|
||||||
|
|
||||||
(with-meta profile
|
(with-meta profile
|
||||||
{::audit/props (audit/profile->props profile)
|
{::audit/replace-props (audit/profile->props profile)
|
||||||
::audit/profile-id (:id profile)}))))))
|
::audit/profile-id (:id profile)}))))))
|
||||||
|
|
||||||
(defn create-profile
|
(defn create-profile
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
"taiga"
|
"taiga"
|
||||||
(cf/get :telemetry-referer))]
|
(cf/get :telemetry-referer))]
|
||||||
(-> {:referer referer
|
(-> {:referer referer
|
||||||
|
:public-uri (cf/get :public-uri)
|
||||||
:total-teams (retrieve-num-teams conn)
|
:total-teams (retrieve-num-teams conn)
|
||||||
:total-projects (retrieve-num-projects conn)
|
:total-projects (retrieve-num-projects conn)
|
||||||
:total-files (retrieve-num-files conn)
|
:total-files (retrieve-num-files conn)
|
||||||
|
|
Loading…
Add table
Reference in a new issue