diff --git a/app/src/plugins/lib@auth/forgot-password/_components/a-forgot-password-form.vue b/app/src/plugins/lib@auth/forgot-password/_components/a-forgot-password-form.vue index d19709d..e930381 100644 --- a/app/src/plugins/lib@auth/forgot-password/_components/a-forgot-password-form.vue +++ b/app/src/plugins/lib@auth/forgot-password/_components/a-forgot-password-form.vue @@ -1,9 +1,9 @@ diff --git a/app/src/plugins/lib@auth/login/_components/a-login-form.vue b/app/src/plugins/lib@auth/login/_components/a-login-form.vue index 41a48d4..86eadde 100644 --- a/app/src/plugins/lib@auth/login/_components/a-login-form.vue +++ b/app/src/plugins/lib@auth/login/_components/a-login-form.vue @@ -1,5 +1,5 @@ @@ -20,11 +20,23 @@ import { required, email, integer, minLength, maxLength, sameAs } from '@vuelida import errorUtils from '@/plugins/lib@auth/_utils/error.utils' export default { + props: { + navigateToAfterPasswordReset: { + type: String, + required: true + } + }, + data() { return { errorUtils, v$: useVuelidate(), - form: {}, + credentials: { + code: '', + email: '', + password: '', + password_confirmation: '' + }, showPassword: false, showConfirmationPassword: false } @@ -32,7 +44,7 @@ export default { validations() { return { - form: { + credentials: { code: { required, integer, minLength: minLength(6), maxLength: maxLength(6) }, email: { required, email }, password: { required, minLength: minLength(12) }, @@ -41,12 +53,17 @@ export default { } }, + created() { + this.credentials.email = new URLSearchParams(window.location.search.substring(1).get('email')) + this.credentials.code = new URLSearchParams(window.location.search.substring(1).get('code')) + }, + methods: { async submit() { if (!(await this.v$.$validate())) return try { - await this.$axios.post_data('v1/auth/reset', this.form) + await this.$store.dispatch('auth/resetPassword', this.credentials) this.$router.push({ name: 'Login' }) } catch (error) { this.$toast.error(error) diff --git a/app/src/plugins/lib@auth/reset-password/reset-password.vue b/app/src/plugins/lib@auth/reset-password/reset-password.vue index ecc41c8..84caa38 100644 --- a/app/src/plugins/lib@auth/reset-password/reset-password.vue +++ b/app/src/plugins/lib@auth/reset-password/reset-password.vue @@ -4,7 +4,7 @@

Reset password

We have sent you a confirmation code on your email. You can insert him or continue with link in your email

- + diff --git a/app/src/plugins/tm@modal/task/z-task-modal.vue b/app/src/plugins/tm@modal/task/z-task-modal.vue index 6ffdd6c..ba8cfaa 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -3,7 +3,7 @@ diff --git a/app/src/plugins/w/auth/auth.store.ts b/app/src/plugins/w/auth/auth.store.ts index 1ae8445..ade4b52 100644 --- a/app/src/plugins/w/auth/auth.store.ts +++ b/app/src/plugins/w/auth/auth.store.ts @@ -86,7 +86,7 @@ export default { // eslint-disable-next-line forgotPassword({commit}: {commit: any}, credentials: any) { return new Promise((resolve, reject) => { - axios.post_auth_data('v1/auth/forgot', credentials) + axios.post_auth_data('v1/users/forgot', credentials) .then(response => resolve(response)) .catch(error => reject(error)) }) @@ -94,7 +94,7 @@ export default { // eslint-disable-next-line resetPassword({commit}: {commit: any}, credentials: any) { return new Promise((resolve, reject) => { - axios.post_auth_data('v1/auth/reset', credentials) + axios.post_auth_data('v1/users/reset', credentials) .then(response => resolve(response)) .catch(error => reject(error)) })