chore: Add business email validation on signup (#6037)
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
"TRY_WOOT": "Register an account",
|
||||
"TITLE": "Register",
|
||||
"TERMS_ACCEPT": "By signing up, you agree to our <a href=\"https://www.chatwoot.com/terms\">T & C</a> and <a href=\"https://www.chatwoot.com/privacy-policy\">Privacy policy</a>",
|
||||
"ACCOUNT_NAME": {
|
||||
"LABEL": "Account name",
|
||||
"PLACEHOLDER": "Enter an account name. eg: Wayne Enterprises",
|
||||
"ERROR": "Account name is too short"
|
||||
"COMPANY_NAME": {
|
||||
"LABEL": "Company name",
|
||||
"PLACEHOLDER": "Enter your company name. eg: Wayne Enterprises",
|
||||
"ERROR": "Company name is too short"
|
||||
},
|
||||
"FULL_NAME": {
|
||||
"LABEL": "Full name",
|
||||
@@ -16,7 +16,7 @@
|
||||
"EMAIL": {
|
||||
"LABEL": "Work email",
|
||||
"PLACEHOLDER": "Enter your work email address. eg: bruce@wayne.enterprises",
|
||||
"ERROR": "Email address is invalid"
|
||||
"ERROR": "Please enter a valid work email address"
|
||||
},
|
||||
"PASSWORD": {
|
||||
"LABEL": "Password",
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
<woot-input
|
||||
v-model="credentials.accountName"
|
||||
:class="{ error: $v.credentials.accountName.$error }"
|
||||
:label="$t('REGISTER.ACCOUNT_NAME.LABEL')"
|
||||
:placeholder="$t('REGISTER.ACCOUNT_NAME.PLACEHOLDER')"
|
||||
:label="$t('REGISTER.COMPANY_NAME.LABEL')"
|
||||
:placeholder="$t('REGISTER.COMPANY_NAME.PLACEHOLDER')"
|
||||
:error="
|
||||
$v.credentials.accountName.$error
|
||||
? $t('REGISTER.ACCOUNT_NAME.ERROR')
|
||||
? $t('REGISTER.COMPANY_NAME.ERROR')
|
||||
: ''
|
||||
"
|
||||
@blur="$v.credentials.accountName.$touch"
|
||||
@@ -104,6 +104,9 @@ import alertMixin from 'shared/mixins/alertMixin';
|
||||
import { DEFAULT_REDIRECT_URL } from '../../constants';
|
||||
import VueHcaptcha from '@hcaptcha/vue-hcaptcha';
|
||||
import { isValidPassword } from 'shared/helpers/Validators';
|
||||
|
||||
const CompanyEmailValidator = require('company-email-validator');
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VueHcaptcha,
|
||||
@@ -136,6 +139,9 @@ export default {
|
||||
email: {
|
||||
required,
|
||||
email,
|
||||
businessEmailValidator(value) {
|
||||
return CompanyEmailValidator.isCompanyEmail(value);
|
||||
},
|
||||
},
|
||||
password: {
|
||||
required,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import Auth from './Auth';
|
||||
import Confirmation from './Confirmation';
|
||||
import Signup from './Signup';
|
||||
import PasswordEdit from './PasswordEdit';
|
||||
import ResetPassword from './ResetPassword';
|
||||
import { frontendURL } from '../../helper/URLHelper';
|
||||
|
||||
const Signup = () => import('./Signup');
|
||||
|
||||
export default {
|
||||
routes: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user