mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-11 17:50:39 +01:00
1 line
3.3 KiB
Plaintext
1 line
3.3 KiB
Plaintext
|
{"version":3,"file":"Reset-cO_ROynR.js","sources":["../../../resources/js/views/auth/password/Reset.vue"],"sourcesContent":["<script setup>\n import Form from '@/components/formElements/Form'\n import { useNotifyStore } from '@/stores/notify'\n\n const notify = useNotifyStore()\n const router = useRouter()\n const route = useRoute()\n \n const isPending = ref(true)\n const form = reactive(new Form({\n email : route.query.email,\n password : '',\n password_confirmation : '',\n token: route.query.token\n }))\n\n /**\n * Submits the password reset to the backend\n */\n function resetPassword(e) {\n form.password_confirmation = form.password\n\n form.post('/user/password/reset', {returnError: true})\n .then(response => {\n form.password = ''\n form.password_confirmation = ''\n isPending.value = false\n notify.success({ text: response.data.message, duration:-1 })\n })\n .catch(error => {\n if( error.response.data.resetFailed ) {\n notify.alert({ text: error.response.data.resetFailed, duration:-1 })\n }\n else if( error.response.status !== 422 ) {\n notify.error(error)\n }\n })\n }\n\n onBeforeRouteLeave(() => {\n notify.clear()\n })\n</script>\n\n<template>\n <FormWrapper :title=\"$t('auth.forms.new_password')\">\n <form @submit.prevent=\"resetPassword\" @keydown=\"form.onKeydown($event)\">\n <FormField v-model=\"form.email\" :isDisabled=\"true\" fieldName=\"email\" :fieldError=\"form.errors.get('email')\" label=\"auth.forms.email\" autofocus />\n <FormPasswordField v-model=\"form.password\" fieldName=\"password\" :fieldError=\"form.errors.get('password')\" autocomplete=\"new-password\" :showRules=\"true\" label=\"auth.forms.new_password\" />\n <FieldError v-if=\"form.errors.get('token') != undefined\" :error=\"form.errors.get('token')\" :field=\"form.token\" />\n <FormButtons\n v-if=\"isPending\"\n :submitId=\"'btnResetPwd'\"\n :isBusy=\"form.isBusy\"\n :caption=\"$t('auth.forms.change_password')\"\n :showCancelButton=\"true\"\n cancelLandingView=\"login\" />\n <RouterLink v-if=\"!isPending\" id=\"btnContinue\" :to=\"{ name: 'accounts' }\" class=\"button is-link\">{{ $t('commons.continue') }}</RouterLink>\n </form>\n <VueFooter />\n </FormWrapper>\n</template>\n"],"names":["notify","useNotifyStore","useRouter","route","useRoute","isPending","ref","form","reactive","Form","resetPassword","e","response","error","onBeforeRouteLeave"],"mappings":"uTAII,MAAMA,EAASC,EAAc,EACdC,EAAS,EACxB,MAAMC,EAAQC,EAAQ,EAEhBC,EAAYC,EAAI,EAAI,EACpBC,EAAOC,EAAS,IAAIC,EAAK,CAC3B,MAAQN,EAAM,MAAM,MACpB,SAAW,GACX,sBAAwB,GACxB,MAAOA,EAAM,MAAM,KAC3B,CAAK,CAAC,EAKF,SAASO,EAAcC,EAAG,CACtBJ,EAAK,sBAAwBA,EAAK,SAElCA,EAAK,KAAK,uBAAwB,CAAC,YAAa,EAAI,CAAC,EACpD,KAAKK,GAAY,CACdL,EAAK,SAAW,GAChBA,EAAK,sBAAwB,GAC7BF,EAAU,MAAQ,GAClBL,EAAO,QAAQ,CAAE,KAAMY,EAAS,KAAK,QAAS,SAAS,EAAI,CAAA,CAC9D,CAAA,EACA,MAAMC,GAAS,CACRA,EAAM,SAAS,KAAK,YACpBb,EAAO,MAAM,CAAE,KAAMa,EAAM,SAAS,KAAK,YAAa,SAAS,EAAI,CAAA,EAE9DA,EAAM,SAAS,SAAW,KAC/Bb,EAAO,MAAMa,CAAK,CAEzB,CAAA,CACT,CAEI,OAAAC,EAAmB,IAAM,CACrBd,EAAO,MAAK,CACf,CAAA"}
|