feat: Migrate allowedDomains to a Team Level Settings (#3489)

Fixes #3412

Previously the only way to restrict the domains for a Team were with the ALLOWED_DOMAINS environment variable for self hosted instances.
This PR migrates this to be a database backed setting on the Team object. This is done through the creation of a TeamDomain model that is associated with the Team and contains the domain name

This settings is updated on the Security Tab. Here domains can be added or removed from the Team.

On the server side, we take the code paths that previously were using ALLOWED_DOMAINS and switched them to use the Team allowed domains instead
This commit is contained in:
Corey Alexander
2022-05-17 20:26:29 -04:00
committed by GitHub
parent 18e0d936ef
commit 51001cfac1
27 changed files with 622 additions and 78 deletions

View File

@@ -21,12 +21,6 @@ export default function Notices() {
installation. Try another?
</NoticeAlert>
)}
{notice === "hd-not-allowed" && (
<NoticeAlert>
Sorry, your Google apps domain is not allowed. Please try again with
an allowed team domain.
</NoticeAlert>
)}
{notice === "malformed_user_info" && (
<NoticeAlert>
We could not read the user info supplied by your identity provider.
@@ -79,6 +73,12 @@ export default function Notices() {
Please request an invite from your team admin and try again.
</NoticeAlert>
)}
{notice === "domain-not-allowed" && (
<NoticeAlert>
Sorry, your domain is not allowed. Please try again with an allowed
team domain.
</NoticeAlert>
)}
</>
);
}