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:
@@ -28,6 +28,14 @@ export function InviteRequiredError(
|
||||
});
|
||||
}
|
||||
|
||||
export function DomainNotAllowedError(
|
||||
message = "The domain is not allowed for this team"
|
||||
) {
|
||||
return httpErrors(403, message, {
|
||||
id: "domain_not_allowed",
|
||||
});
|
||||
}
|
||||
|
||||
export function AdminRequiredError(
|
||||
message = "An admin role is required to access this resource"
|
||||
) {
|
||||
@@ -130,14 +138,6 @@ export function GoogleWorkspaceRequiredError(
|
||||
});
|
||||
}
|
||||
|
||||
export function GoogleWorkspaceInvalidError(
|
||||
message = "Google Workspace is invalid"
|
||||
) {
|
||||
return httpErrors(400, message, {
|
||||
id: "hd_not_allowed",
|
||||
});
|
||||
}
|
||||
|
||||
export function OIDCMalformedUserInfoError(
|
||||
message = "User profile information malformed"
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user