diff --git a/src/views/main/Register.vue b/src/views/main/Register.vue
index 190bb6a..a527f71 100644
--- a/src/views/main/Register.vue
+++ b/src/views/main/Register.vue
@@ -5,7 +5,7 @@
-
diff --git a/src/views/main/RegisterForm.vue b/src/views/main/RegisterForm.vue
index d9bf7fc..7019206 100644
--- a/src/views/main/RegisterForm.vue
+++ b/src/views/main/RegisterForm.vue
@@ -1,6 +1,6 @@
-
+
Inscription
@@ -12,6 +12,7 @@
prepend-inner-icon="mdi-account"
color="transparent"
class="text-black mb-4"
+ :rules="[userNameRule]"
>
= 6;
-
- return digitRegex.test(password) &&
- lowercaseRegex.test(password) &&
- uppercaseRegex.test(password) &&
- nonAlphanumericRegex.test(password) &&
- lengthRequirement;
+function passwordRule(password) {
+ if (passwordRegex.test(password)) {
+ return true;
+ }
+ return ERROR_MESSAGES.WEAK_PASSWORD;
}
-function validateEmail(email) {
- const emailRegex = /.+@.+\..+/;
- return emailRegex.test(email);
+function validatePasswordRule(validatePassword) {
+ if (password.value === validatePassword) {
+ return true;
+ }
+ return ERROR_MESSAGES.PASSWORD_MISMATCH;
+}
+
+function emailRule(email) {
+ if (emailRegex.test(email)) {
+ return true;
+ }
+ return ERROR_MESSAGES.INVALID_EMAIL
+}
+
+function userNameRule(userName) {
+ if (userNameRegex.test(userName)){
+ return true
+ }
+ return ERROR_MESSAGES.INVALID_USERNAME;
}
function validateForm() {
emailError.value = false;
emailErrorMessage.value = '';
- if (!validateEmail(emailAddress.value)) {
+ if (!emailRegex.test(emailAddress.value)) {
emailError.value = true;
emailErrorMessage.value = ERROR_MESSAGES.INVALID_EMAIL;
return;
}
+
+ if (!userNameRegex.test(userName.value)){
+ showErrorDialog(ERROR_MESSAGES.INVALID_EMAIL);
+ return;
+ }
if (password.value !== confirmPassword.value) {
showErrorDialog(ERROR_MESSAGES.PASSWORD_MISMATCH);
return;
}
- if (!validatePassword(password.value)) {
+ if (!passwordRegex.test(password.value)) {
showErrorDialog(ERROR_MESSAGES.WEAK_PASSWORD);
return;
}
diff --git a/src/views/main/SelectedFooter.vue b/src/views/main/SelectedFooter.vue
index 7829c4e..4b160d7 100644
--- a/src/views/main/SelectedFooter.vue
+++ b/src/views/main/SelectedFooter.vue
@@ -1,9 +1,9 @@
-
+
+
-