fix: prevent registration with empty group name (#8105)

Co-authored-by: jl1204 <jl1204@students.waikato.ac.nz>
This commit is contained in:
Luna-81andjl1204 authored and GitHub committed 2026-08-16 15:53:13 +00:00
1 parent 8d92309b94
commit 96a6fd822b
1 file changed
+16 -2
+16 -2
View File
@@ -394,12 +394,26 @@ const { validate: validGroupName, valid: groupNameValid } = useAsyncValidator(
i18n.t("validation.group-name-is-taken"),
groupErrorMessages,
);
async function validateGroup() {
if (!groupName.value || groupName.value.trim() === '') {
groupErrorMessages.value = [i18n.t("validation.required")];
return false;
}
groupErrorMessages.value = [];
await validGroupName();
if (!groupNameValid.value) {
return false;
}
return true;
}
const groupDetails = {
groupName,
groupSeed,
groupPrivate,
next: () => {
if (!safeValidate(domGroupForm as Ref<VForm>) || !groupNameValid.value) {
next: async () => {
if (!await validateGroup()) {
return;
}
state.setState(States.ProvideAccountDetails);