How to use the vuelidate/lib/validators.sameAs function in vuelidate

To help you get started, we’ve selected a few vuelidate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frankfoerster / tipsy / src / Assets / js / src / views / Signup.vue View on Github external
validations: {
      email: {
        required,
        email: email
      },
      username: {
        required,
        minLength: minLength(2)
      },
      password: {
        required,
        minLength: minLength(8)
      },
      passwordConfirmation: {
        required,
        sameAsPassword: sameAs('password')
      }
    },

    methods: {
      validateBeforeSubmit() {
        this.$v.$touch();
        if (this.$v.$invalid) {
          this.shake = true;
          this.focusFirstFormControlWithError();
        } else {
          this.loading = true;
          this.submit().finally(() => {
            this.loading = false;
          });
        }
      },
github iurii-kyrylenko / hobbies / front-end / src / helpers / validators.js View on Github external
{
    rule (value) {
      const regexp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\S{8,}$/
      return regexp.test(value)
    },
    msg: 'Password requires at least 8 characters without spaces, one number, one lowercase and one uppercase letter'
  }
]

export const confirmation = [
  {
    rule: required,
    msg: 'Confirmation is required'
  },
  {
    rule: sameAs('password'),
    msg: 'Password mismatch'
  }
]

export const bookTitle = [
  {
    rule: required,
    msg: 'Book title is required'
  }
]

export const author = [
  {
    rule: required,
    msg: 'Author is required'
  }
github DivanteLtd / vue-storefront / src / themes / default / components / core / blocks / MyAccount / MyProfile.vue View on Github external
unicodeAlpha
      },
      email: {
        required,
        email
      }
    },
    oldPassword: {
      required
    },
    password: {
      required
    },
    rPassword: {
      required,
      sameAsPassword: sameAs('password')
    },
    userCompany: {
      company: {
        required
      },
      country: {
        required
      },
      street: {
        required,
        unicodeAlphaNum
      },
      house: {
        required,
        unicodeAlphaNum
      },
github alexvladanvar / attent / frontend / src / views / Signup.vue View on Github external
email,
  minLength,
  maxLength,
  sameAs
} from 'vuelidate/lib/validators'
import { mapState, mapActions } from 'vuex'
export default {
  mixins: [validationMixin],

  validations: {
    name: { required, minLength: minLength(4), maxLength: maxLength(30) },
    email: { required, email },
    password: { required, minLength: minLength(5), maxLength: maxLength(100) },
    select: { required },
    group: { required },
    password2: { required, sameAs: sameAs('password') }
  },

  data: () => ({
    group: '',
    name: '',
    email: '',
    password: '',
    password2: '',
    select: null,
    items: ['Student', 'Teacher']
  }),

  computed: {
    ...mapState(['loading']),
    selectErrors() {
      const errors = []
github DivanteLtd / vue-storefront / src / themes / migration / components / core / blocks / Auth / Register.vue View on Github external
required,
      email
    },
    firstName: {
      required
    },
    lastName: {
      required
    },
    password: {
      minLength: minLength(8),
      required
    },
    rPassword: {
      required,
      sameAsPassword: sameAs('password')
    },
    conditions: {
      required
    }
  },
  mixins: [Register],
  components: {
    ButtonFull,
    BaseCheckbox,
    BaseInput
  },
  methods: {
    register () {
      if (this.$v.$invalid) {
        this.$v.$touch()
        this.$store.dispatch('notification/spawnNotification', {
github luniehq / lunie / src / components / common / TmSessionSignUpSeed.vue View on Github external
validations: () => ({
    fieldWarning: { required: sameAs(() => true) }
  })
}
github DivanteLtd / vue-storefront / src / themes / migration / components / core / blocks / Checkout / PersonalDetails.vue View on Github external
minLength: minLength(3)
      },
      lastName: {
        required
      },
      emailAddress: {
        required,
        email
      }
    },
    password: {
      required
    },
    rPassword: {
      required,
      sameAsPassword: sameAs('password')
    },
    acceptConditions: {
      required
    }
  }
}
github DivanteLtd / vue-storefront / src / themes / migration / components / core / blocks / MyAccount / MyProfile.vue View on Github external
required
      },
      email: {
        required,
        email
      }
    },
    oldPassword: {
      required
    },
    password: {
      required
    },
    rPassword: {
      required,
      sameAsPassword: sameAs('password')
    },
    userCompany: {
      company: {
        required
      },
      country: {
        required
      },
      street: {
        required
      },
      house: {
        required
      },
      postcode: {
        required,
github bytefury / crater / resources / assets / js / views / wizard / UserProfile.vue View on Github external
profileData: {
      name: {
        required,
        minLength: minLength(3)
      },
      email: {
        email,
        required
      },
      password: {
        required,
        minLength: minLength(5)
      },
      confirm_password: {
        required: requiredIf('isRequired'),
        sameAsPassword: sameAs('password')
      }
    }
  },
  computed: {
    isRequired () {
      if (this.profileData.password === null || this.profileData.password === undefined || this.profileData.password === '') {
        return false
      }
      return true
    }
  },
  methods: {
    ...mapActions('userProfile', [
      'uploadOnboardAvatar'
    ]),
    cropperHandler (cropper) {