mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Domain validation. Filter domain from referrers.
This commit is contained in:
parent
a9765c7ea7
commit
5a4cde854a
13 changed files with 51 additions and 23 deletions
|
|
@ -8,7 +8,8 @@ import FormLayout, {
|
|||
FormMessage,
|
||||
FormRow,
|
||||
} from 'components/layout/FormLayout';
|
||||
import Checkbox from '../common/Checkbox';
|
||||
import Checkbox from 'components/common/Checkbox';
|
||||
import { DOMAIN_REGEX } from 'lib/constants';
|
||||
|
||||
const initialValues = {
|
||||
name: '',
|
||||
|
|
@ -24,6 +25,8 @@ const validate = ({ name, domain }) => {
|
|||
}
|
||||
if (!domain) {
|
||||
errors.domain = 'Required';
|
||||
} else if (!DOMAIN_REGEX.test(domain)) {
|
||||
errors.domain = 'Invalid domain';
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue