mirror of
https://github.com/penpot/penpot.git
synced 2025-05-04 22:05:55 +02:00
Merge pull request #4917 from penpot/superalex-fix-flag-email-verification
🐛 Fix flag email verification
This commit is contained in:
commit
08c8c47006
1 changed files with 6 additions and 3 deletions
|
@ -340,7 +340,7 @@
|
||||||
|
|
||||||
profile (if-let [profile-id (:profile-id claims)]
|
profile (if-let [profile-id (:profile-id claims)]
|
||||||
(profile/get-profile conn profile-id)
|
(profile/get-profile conn profile-id)
|
||||||
(let [is-active (or (boolean (:is-active params))
|
(let [is-active (or (boolean (:is-active claims))
|
||||||
(not (contains? cf/flags :email-verification)))
|
(not (contains? cf/flags :email-verification)))
|
||||||
params (-> params
|
params (-> params
|
||||||
(assoc :is-active is-active)
|
(assoc :is-active is-active)
|
||||||
|
@ -348,6 +348,9 @@
|
||||||
(->> (create-profile! conn params)
|
(->> (create-profile! conn params)
|
||||||
(create-profile-rels! conn))))
|
(create-profile-rels! conn))))
|
||||||
|
|
||||||
|
;; When no profile-id comes on claims means a new register
|
||||||
|
created? (not (:profile-id claims))
|
||||||
|
|
||||||
invitation (when-let [token (:invitation-token params)]
|
invitation (when-let [token (:invitation-token params)]
|
||||||
(tokens/verify (::setup/props cfg) {:token token :iss :team-invitation}))
|
(tokens/verify (::setup/props cfg) {:token token :iss :team-invitation}))
|
||||||
|
|
||||||
|
@ -385,8 +388,8 @@
|
||||||
;; When a new user is created and it is already activated by
|
;; When a new user is created and it is already activated by
|
||||||
;; configuration or specified by OIDC, we just mark the profile
|
;; configuration or specified by OIDC, we just mark the profile
|
||||||
;; as logged-in
|
;; as logged-in
|
||||||
(not (:profile-id claims))
|
created?
|
||||||
(if (:is-active claims)
|
(if (:is-active profile)
|
||||||
(-> (profile/strip-private-attrs profile)
|
(-> (profile/strip-private-attrs profile)
|
||||||
(rph/with-transform (session/create-fn cfg (:id profile)))
|
(rph/with-transform (session/create-fn cfg (:id profile)))
|
||||||
(rph/with-meta
|
(rph/with-meta
|
||||||
|
|
Loading…
Add table
Reference in a new issue