mirror of
https://github.com/penpot/penpot.git
synced 2025-05-16 12:56:11 +02:00
🎉 Add registration domain whitelist for emails
Signed-off-by: Andrey Miskov <amiskov@gmail.com>
This commit is contained in:
parent
394d238f97
commit
c663d54eb8
4 changed files with 26 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.mutations.profile :as profile]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
|
@ -191,6 +192,15 @@
|
|||
(t/is (= 0 (count (:result out))))))
|
||||
))
|
||||
|
||||
(t/deftest registration-domain-whitelist
|
||||
(let [whitelist "gmail.com, hey.com, ya.ru"]
|
||||
(t/testing "allowed email domain"
|
||||
(t/is (true? (profile/email-domain-in-whitelist? whitelist "username@ya.ru")))
|
||||
(t/is (true? (profile/email-domain-in-whitelist? "" "username@somedomain.com"))))
|
||||
|
||||
(t/testing "not allowed email domain"
|
||||
(t/is (false? (profile/email-domain-in-whitelist? whitelist "username@somedomain.com"))))))
|
||||
|
||||
;; TODO: profile deletion with teams
|
||||
;; TODO: profile deletion with owner teams
|
||||
;; TODO: profile registration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue