validator tweak

This commit is contained in:
Rory Powell 2022-01-20 16:25:09 +00:00
parent 4fb9a4aa59
commit 6e5957a01a
1 changed files with 8 additions and 1 deletions

View File

@ -63,7 +63,14 @@ export const url = (validation, { apps, currentApp } = { apps: {} }) => {
if (!value) { if (!value) {
return true return true
} }
return value.startsWith("/") && value.length > 1 // make it clear that this is a url path and cannot be a full url
return (
value.startsWith("/") &&
!value.includes("http") &&
!value.includes("www") &&
!value.includes(".") &&
value.length > 1 // just '/' is not valid
)
}) })
) )
} }