+
@@ -198,7 +199,7 @@
debounce="1000"
@keyup.enter="$refs.inputSurname.focus()"
:error-message="tools.errorMsg('name', v$.name)"
- :label="$t('reg.name_opt')"
+ :label="tools.getConfSiteOptionEnabled(shared_consts.ConfSite.regNameSurnameMandatory) ? $t('reg.name') : $t('reg.name_opt')"
>
@@ -427,7 +428,7 @@
tools.errorMsg('username', v$.username) ||
(isalreadyReg ? 'L\'Username è gia stato registrato!' : '')
"
- :label="collettivo ? $t('reg.username_reg_collettivo') : $t('reg.username_reg')"
+ :label="collettivo ? $t('reg.username_reg_collettivo') : (tools.getConfSiteOptionEnabled(shared_consts.ConfSite.askUSernameTelegramToTheReg) ? $t('reg.username_telegram') : $t('reg.username_reg'))"
>
@@ -468,7 +469,7 @@
debounce="1000"
@keyup.enter="$refs.inputSurname.focus()"
:error-message="tools.errorMsg('name', v$.name)"
- :label="$t('reg.name_opt')"
+ :label="tools.getConfSiteOptionEnabled(shared_consts.ConfSite.regNameSurnameMandatory) ? $t('reg.name') : $t('reg.name_opt')"
>
@@ -488,7 +489,7 @@
!checkifDisabled ? $refs.carousel.next() : null
"
:error-message="tools.errorMsg('surname', v$.surname)"
- :label="$t('reg.surname_opt')"
+ :label="tools.getConfSiteOptionEnabled(shared_consts.ConfSite.regNameSurnameMandatory) ? $t('reg.surname') : $t('reg.surname_opt')"
>
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index a1fe3182..b2006e31 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -291,6 +291,14 @@ export const tools = {
label: 'Permetti di registrarsi in automatico solo entrando sul BOT',
value: shared_consts.ConfSite.registerUserWithBot,
},
+ {
+ label: 'Nome e Cognome Obbligatori in fase di registrazione',
+ value: shared_consts.ConfSite.regNameSurnameMandatory,
+ },
+ {
+ label: 'Username Telegram in fase di Registrazione',
+ value: shared_consts.ConfSite.askUSernameTelegramToTheReg,
+ },
],
@@ -8365,6 +8373,14 @@ export const tools = {
return mylink.replace('{site}', site).replace('{value}', value);
},
+ rimuoviAtInizio(stringa: string) {
+ if (stringa.startsWith('@')) {
+ return stringa.substring(1);
+ } else {
+ return stringa;
+ }
+ },
+
// FINE !
// getLocale() {
diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts
index 9e8e7fc6..058d3c03 100755
--- a/src/store/UserStore.ts
+++ b/src/store/UserStore.ts
@@ -1289,7 +1289,7 @@ export const useUserStore = defineStore('UserStore', {
}
const usertosend = {
- username: authData.username.trim(),
+ username: tools.rimuoviAtInizio(authData.username.trim()),
password: authData.password.trim(),
lang: this.lang,
options,
diff --git a/src/validation/complexity.ts b/src/validation/complexity.ts
index e9c6ddfe..2ac9c6d2 100755
--- a/src/validation/complexity.ts
+++ b/src/validation/complexity.ts
@@ -1,9 +1,10 @@
import { Patterns } from '@/common'
+import { tools } from '../store/Modules/tools'
export function complexity(password: string) {
return Patterns.Password.test(password)
}
export function complexityUser(username: string) {
- return Patterns.Username.test(username)
+ return Patterns.Username.test(tools.rimuoviAtInizio(username))
}
diff --git a/src/validation/registereduser.ts b/src/validation/registereduser.ts
index 5c99c9bd..d733fe81 100755
--- a/src/validation/registereduser.ts
+++ b/src/validation/registereduser.ts
@@ -2,6 +2,8 @@ import { default as Axios, AxiosResponse } from 'axios'
// import { IPayload } from 'model'
import { GlobalConfig, PayloadMessageTypes } from '../common'
+import { tools } from '@store/Modules/tools'
+
import { helpers } from '@vuelidate/validators'
const { withAsync } = helpers
@@ -16,7 +18,7 @@ export function _registereduser (userName: string) {
return res.status !== PayloadMessageTypes.statusfound
}
- return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + userName)
+ return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + tools.rimuoviAtInizio(userName))
.then(onSuccess)
.catch((err) => {
return true