Files
outline/server/presenters/team.ts
Corey Alexander 51001cfac1 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
2022-05-17 20:26:29 -04:00

22 lines
661 B
TypeScript

import { Team } from "@server/models";
export default function present(team: Team) {
return {
id: team.id,
name: team.name,
avatarUrl: team.logoUrl,
sharing: team.sharing,
memberCollectionCreate: team.memberCollectionCreate,
collaborativeEditing: team.collaborativeEditing,
defaultCollectionId: team.defaultCollectionId,
documentEmbeds: team.documentEmbeds,
guestSignin: team.emailSigninEnabled,
subdomain: team.subdomain,
domain: team.domain,
url: team.url,
defaultUserRole: team.defaultUserRole,
inviteRequired: team.inviteRequired,
allowedDomains: team.allowedDomains.map((d) => d.name),
};
}