diff options
| author | 2024-11-21 14:09:58 +0100 | |
|---|---|---|
| committer | 2024-11-21 13:09:58 +0000 | |
| commit | 301543616b5376585a7caff097499421acdf1806 (patch) | |
| tree | 4cac6aea2c33687b1339fc3bc18e6eb64def6f9a /web/source/settings/views/admin/actions | |
| parent | [feature] Allow emoji shortcode to be 1-character length (#3556) (diff) | |
| download | gotosocial-301543616b5376585a7caff097499421acdf1806.tar.xz | |
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes
* fix typescript complaining
* lint
* make filenames more consistent
* test own domain excluded
Diffstat (limited to 'web/source/settings/views/admin/actions')
| -rw-r--r-- | web/source/settings/views/admin/actions/keys/expireremote.tsx | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/web/source/settings/views/admin/actions/keys/expireremote.tsx b/web/source/settings/views/admin/actions/keys/expireremote.tsx index 1d62f9439..082f1fdff 100644 --- a/web/source/settings/views/admin/actions/keys/expireremote.tsx +++ b/web/source/settings/views/admin/actions/keys/expireremote.tsx @@ -22,32 +22,11 @@ import { TextInput } from "../../../../components/form/inputs"; import MutationButton from "../../../../components/form/mutation-button"; import { useTextInput } from "../../../../lib/form"; import { useInstanceKeysExpireMutation } from "../../../../lib/query/admin/actions"; -import isValidDomain from "is-valid-domain"; +import { formDomainValidator } from "../../../../lib/util/formvalidators"; export default function ExpireRemote({}) { const domainField = useTextInput("domain", { - validator: (v: string) => { - if (v.length === 0) { - return ""; - } - - if (v[v.length-1] === ".") { - return "invalid domain"; - } - - const valid = isValidDomain(v, { - subdomain: true, - wildcard: false, - allowUnicode: true, - topLevel: false, - }); - - if (valid) { - return ""; - } - - return "invalid domain"; - } + validator: formDomainValidator, }); const [expire, expireResult] = useInstanceKeysExpireMutation(); |
