diff --git a/backend/src/app/rpc/commands/auth.clj b/backend/src/app/rpc/commands/auth.clj index e4b36e84b..50f575755 100644 --- a/backend/src/app/rpc/commands/auth.clj +++ b/backend/src/app/rpc/commands/auth.clj @@ -340,7 +340,7 @@ 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) @@ -348,6 +348,9 @@ (->> (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})) @@ -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