chore: Block all email providers from being added as team domains (#3678)

This commit is contained in:
Tom Moor
2022-06-21 11:29:43 +03:00
committed by GitHub
parent 9cd3ec0868
commit 305de71e8b
8 changed files with 56 additions and 27 deletions

View File

@@ -1,9 +1,11 @@
import emailProviders from "email-providers";
import {
Column,
Table,
BelongsTo,
ForeignKey,
NotEmpty,
NotIn,
} from "sequelize-typescript";
import Team from "./Team";
import User from "./User";
@@ -13,6 +15,10 @@ import Fix from "./decorators/Fix";
@Table({ tableName: "team_domains", modelName: "team_domain" })
@Fix
class TeamDomain extends IdModel {
@NotIn({
args: [emailProviders],
msg: "You chose a restricted domain, please try another.",
})
@NotEmpty
@Column
name: string;