Initial commit

This commit is contained in:
Matej Glasnák committed 2022-11-21 05:42:38 +01:00
commit d76f4258f7
231 files changed
+27803

No files matched your search

@@ -0,0 +1,57 @@
<template>
<v-form>
<v-text-field v-model="form.code" label="Kód" bg-color="white" variant="solo" type="number" class="mb-2" :hint="v$.form.code.$errors ? errorUtils.parseErrors(v$.form.code.$errors) : null" :counter="6" :class="{ error: v$.form.code.$errors.length }" />
<v-text-field v-model="form.email" label="E-mail" bg-color="white" variant="solo" type="email" class="mb-2" :hint="v$.form.email.$errors ? errorUtils.parseErrors(v$.form.email.$errors) : null" :class="{ error: v$.form.email.$errors.length }" />
<v-text-field v-model="form.password" label="Heslo" bg-color="white" variant="solo" :type="showPassword ? 'text' : 'password'" class="mb-2" :hint="v$.form.password.$errors ? errorUtils.parseErrors(v$.form.password.$errors) : null" :class="{ error: v$.form.password.$errors.length }" :counter="8" :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showPassword = !showPassword" />
<v-text-field v-model="form.password_confirmation" bg-color="white" variant="solo" label="Potvrdenie hesla" :type="showConfirmationPassword ? 'text' : 'password'" :counter="8" class="mb-2" :hint="v$.form.password_confirmation.$errors ? errorUtils.parseErrors(v$.form.password_confirmation.$errors) : null" :class="{ error: v$.form.password_confirmation.$errors.length }" :append-icon="showConfirmationPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showConfirmationPassword = !showConfirmationPassword" />
<div class="d-flex flex-column">
<v-btn class="button" color="#7F39FB" @click="submit()">Zmeniť heslo</v-btn>
</div>
</v-form>
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { required, email, integer, minLength, maxLength, sameAs } from '@vuelidate/validators'
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
export default {
data() {
return {
errorUtils,
v$: useVuelidate(),
form: {},
showPassword: false,
showConfirmationPassword: false
}
},
validations() {
return {
form: {
code: { required, integer, minLength: minLength(6), maxLength: maxLength(6) },
email: { required, email },
password: { required, minLength: minLength(8) },
password_confirmation: { required, minLength: minLength(8), sameAs: sameAs(this.form.password)}
}
}
},
methods: {
async submit() {
if (!(await this.v$.$validate())) return console.log(this.v$)
try {
await this.$axios.post_data('v1/auth/forgot', this.form)
this.$router.push({ name: 'Reset password' })
} catch (error) {
this.$toast.error(error.data.error)
}
}
}
}
</script>
@@ -0,0 +1,20 @@
<template>
<v-container>
<div class="auth-card">
<h1>Resetovať heslo</h1>
<p class="mb-10">Overovací kód sme Vám odoslali na email. Môžete ho sem vložiť, alebo pokračovať pomocou odkazu v emaile.</p>
<A-reset-password-form />
</div>
</v-container>
</template>
<script>
import AResetPasswordForm from './_components/a-reset-password-form.vue'
export default {
components: {
AResetPasswordForm
}
}
</script>