feat(workspace): expand forbidden subdomain validation (#9082)

Added new forbidden words and regex patterns to subdomain validation in
`update-workspace-input`. Enhanced the `ForbiddenWords` validator to
support both strings and regex matching. Updated tests to verify
regex-based forbidden subdomain validation.

Fix #9064

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Antoine Moreaux
2024-12-18 16:46:59 +01:00
committed by GitHub
parent 550756c2bf
commit 2bcce44e08
8 changed files with 126 additions and 86 deletions

View File

@ -101,7 +101,8 @@ export const SettingsDomain = () => {
} catch (error) {
if (
error instanceof Error &&
error.message === 'Subdomain already taken'
(error.message === 'Subdomain already taken' ||
error.message.endsWith('not allowed'))
) {
control.setError('subdomain', {
type: 'manual',