Improve disabled registry flows

This commit is contained in:
Alejandro Alonso 2024-08-19 15:42:54 +02:00
parent 00bb988ecc
commit cd51f2f652
6 changed files with 99 additions and 30 deletions

View file

@ -180,10 +180,11 @@
(defn- validate-register-attempt!
[cfg params]
(when-not (contains? cf/flags :registration)
(when-not (contains? params :invitation-token)
(ex/raise :type :restriction
:code :registration-disabled)))
(when (or
(not (contains? cf/flags :registration))
(not (contains? cf/flags :login-with-password)))
(ex/raise :type :restriction
:code :registration-disabled))
(when (contains? params :invitation-token)
(let [invitation (tokens/verify (::setup/props cfg)