1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

validator tweak

This commit is contained in:
Rory Powell 2022-01-20 16:25:09 +00:00
parent 31ed47a221
commit 4b787fefc9

View file

@ -63,7 +63,14 @@ export const url = (validation, { apps, currentApp } = { apps: {} }) => {
if (!value) {
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
)
})
)
}