Skip to content

Commit

Permalink
🐛 Fix flag email verification
Browse files Browse the repository at this point in the history
  • Loading branch information
superalex authored and niwinz committed Jul 24, 2024
1 parent 51611fb commit a6d738f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/src/app/rpc/commands/auth.clj
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,17 @@

profile (if-let [profile-id (:profile-id claims)]
(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)))
params (-> params
(assoc :is-active is-active)
(update :password #(profile/derive-password cfg %)))]
(->> (create-profile! conn params)
(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)]
(tokens/verify (::setup/props cfg) {:token token :iss :team-invitation}))

Expand Down Expand Up @@ -385,8 +388,8 @@
;; When a new user is created and it is already activated by
;; configuration or specified by OIDC, we just mark the profile
;; as logged-in
(not (:profile-id claims))
(if (:is-active claims)
created?
(if (:is-active profile)
(-> (profile/strip-private-attrs profile)
(rph/with-transform (session/create-fn cfg (:id profile)))
(rph/with-meta
Expand Down

0 comments on commit a6d738f

Please sign in to comment.