chore: Block all email providers from being added as team domains (#3678)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user