{"version":3,"sources":["webpack:///./src/views/auth/ResetPassword.vue?ffa3","webpack:///./src/views/auth/ResetPasswordMachine.ts","webpack:///./src/views/auth/ResetPassword.vue?df8e","webpack:///./src/views/auth/ResetPassword.vue?434b","webpack:///./src/views/auth/ResetPassword.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","on","$event","preventDefault","service","send","model","value","form","callback","$$v","$set","expression","staticClass","attrs","state","matches","_v","_s","$t","_e","mapValidationErrors","validations","password","id","errors","Password","fields","passwordRepeat","PasswordRepeat","$invalid","staticRenderFns","resetPasswordMachine","Machine","initial","states","verify","RESOLVE","REJECT","idle","RESET","failure","type","loading","success","Component","defineComponent","setup","props","vm","ref","_useMachine","useMachine","ResetPasswordMachine","api","AuthenticationApi","reactive","valid","passwordResetToken","useVuelidate","required","isPassword","$autoDirty","sameAs","verifyResetToken","_x","_verifyResetToken","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","authenticationIsPasswordResetTokenValid","t0","stop","passwordReset","_passwordReset","_callee2","_context2","authenticationResetPassword","response","data","onMounted","root","$route","params","token","subscribe","s","component","VAlert","VBtn","VCard","VCardActions","VCardText","VForm","VSpacer","VTextField","VToolbar","VToolbarTitle"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,SAAS,CAACE,GAAG,CAAC,OAAS,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBR,EAAIS,QAAQC,KAAK,WAAWC,MAAM,CAACC,MAAOZ,EAAIa,KAAU,MAAEC,SAAS,SAAUC,GAAMf,EAAIgB,KAAKhB,EAAIa,KAAM,QAASE,IAAME,WAAW,eAAe,CAACb,EAAG,SAAS,CAACc,YAAY,eAAeC,MAAM,CAAC,UAAUnB,EAAIoB,MAAMC,QAAQ,YAAa,WAAmB,CAACjB,EAAG,YAAY,CAACe,MAAM,CAAC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CnC,SAAUf,EAAKmB,OAAOJ,WACtB,OACFnB,EAAQC,KAAK,WAAW8E,EAAAP,KAAA,gBAAAO,EAAAR,KAAA,EAAAQ,EAAAL,GAAAK,EAAA,YAExB3E,EAAKiB,OAAS0D,EAAAL,GAAIO,SAASC,KAAK7D,OAChCrB,EAAQC,KAAK,UAAU,yBAAA8E,EAAAJ,UAAAG,EAAA,kBAE1BD,EAAAd,MAAA,KAAAC,WAgBD,OAdAmB,wBAAU,WACJtC,EAAGuC,KAAKC,OAAOC,OAAOC,MACxB3B,EAAiBf,EAAGuC,KAAKC,OAAOC,OAAOC,OAEvCvF,EAAQC,KAAK,UAGfD,EAAQwF,WAAU,SAACC,GACbA,EAAE7E,QAAQ,YACZgE,UAKC,CACLxE,OACAa,2BACAjB,UACAC,OACAU,YAKS8B,IChNyc,I,6ICOpdiD,EAAY,eACd,EACApG,EACAqC,GACA,EACA,KACA,KACA,MAIa,aAAA+D,EAAiB,QAchC,IAAkBA,EAAW,CAACC,SAAA,KAAOC,OAAA,KAAKC,QAAA,KAAMC,aAAA,OAAaC,UAAA,OAAUC,QAAA,KAAMC,UAAA,KAAQC,aAAA,KAAWC,WAAA,KAASC,cAAA","file":"js/chunk-2d0aef68.4db4ff03.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.service.send('RESET')}},model:{value:(_vm.form.valid),callback:function ($$v) {_vm.$set(_vm.form, \"valid\", $$v)},expression:\"form.valid\"}},[_c('v-card',{staticClass:\"elevation-10\",attrs:{\"loading\":_vm.state.matches('loading') ? 'accent' : false}},[_c('v-toolbar',{attrs:{\"color\":\"black\",\"dark\":\"\",\"flat\":\"\"}},[_c('v-toolbar-title',[_vm._v(_vm._s(_vm.$t(\"account.reset-password\")))]),_c('v-spacer')],1),(_vm.state.matches('success'))?[_c('v-card-text',[_c('v-alert',{attrs:{\"outlined\":\"\",\"type\":\"success\",\"prominent\":\"\",\"border\":\"left\"}},[_vm._v(\" \"+_vm._s(_vm.$t(\"account.reset-password-success\"))+\" \"),_c('p',[_c('router-link',{staticClass:\"link\",attrs:{\"to\":\"/\"}},[_vm._v(_vm._s(_vm.$t(\"account.login-button\")))])],1)])],1)]:[_c('v-card-text',{staticClass:\"pb-0 pt-5\"},[_c('v-alert',{attrs:{\"outlined\":\"\",\"type\":\"info\",\"prominent\":\"\",\"border\":\"left\"}},[_vm._v(\" Welkom terug bij BFNL! Stel hier je wachtwoord in. \"),_c('br'),_c('br'),_vm._v(\" \"+_vm._s(_vm.$t(\"errors.password-invalid\"))+\" \")]),(_vm.state.matches('failure'))?_c('v-alert',{attrs:{\"outlined\":\"\",\"type\":\"error\",\"prominent\":\"\",\"border\":\"left\"}},[_vm._v(\" \"+_vm._s(_vm.$t(\"generic.request-failed\"))+\" \")]):_vm._e(),_c('v-text-field',{staticClass:\"mb-5\",attrs:{\"label\":_vm.$t('account.password'),\"name\":\"login\",\"prepend-icon\":\"mdi-account\",\"type\":\"password\",\"error-messages\":_vm.mapValidationErrors(\n _vm.form.validations.password,\n _vm.$t('account.password'),\n {\n id: 'password',\n errors: _vm.form.errors,\n }\n )},on:{\"focus\":function($event){_vm.form.errors.Password = ''}},model:{value:(_vm.form.fields.password),callback:function ($$v) {_vm.$set(_vm.form.fields, \"password\", $$v)},expression:\"form.fields.password\"}}),_c('v-text-field',{staticClass:\"mb-5\",attrs:{\"label\":_vm.$t('account.password-repeat'),\"name\":\"login\",\"prepend-icon\":\"mdi-account\",\"type\":\"password\",\"error-messages\":_vm.mapValidationErrors(\n _vm.form.validations.passwordRepeat,\n _vm.$t('account.password'),\n {\n id: 'passwordRepeat',\n errors: _vm.form.errors,\n }\n )},on:{\"focus\":function($event){_vm.form.errors.PasswordRepeat = ''}},model:{value:(_vm.form.fields.passwordRepeat),callback:function ($$v) {_vm.$set(_vm.form.fields, \"passwordRepeat\", $$v)},expression:\"form.fields.passwordRepeat\"}})],1),_c('v-card-actions',[_c('v-btn',{attrs:{\"block\":\"\",\"disabled\":_vm.form.validations.$invalid || _vm.state.matches('loading'),\"color\":\"primary\",\"type\":\"submit\",\"large\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.$t(\"account.reset-password\"))+\" \")])],1)]],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Machine } from \"xstate\";\r\n\r\nconst resetPasswordMachine = Machine({\r\n id: \"reset-password\",\r\n initial: \"verify\",\r\n states: {\r\n verify: {\r\n on: {\r\n RESOLVE: \"idle\",\r\n REJECT: \"failure\",\r\n },\r\n },\r\n idle: {\r\n on: {\r\n RESET: \"loading\",\r\n },\r\n },\r\n failure: {\r\n type: \"final\",\r\n },\r\n loading: {\r\n on: {\r\n RESOLVE: \"success\",\r\n REJECT: \"idle\",\r\n },\r\n },\r\n success: {\r\n type: \"final\",\r\n },\r\n },\r\n});\r\n\r\nexport default resetPasswordMachine;\r\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport {\r\n defineComponent,\r\n onMounted,\r\n reactive,\r\n ref,\r\n} from \"@vue/composition-api\";\r\nimport { required, sameAs } from \"@vuelidate/validators\";\r\nimport { useMachine } from \"@xstate/vue\";\r\nimport useVuelidate from \"@vuelidate/core\";\r\n\r\nimport { AuthenticationApi } from \"@/api\";\r\nimport isPassword from \"@/util/validators/password\";\r\nimport { mapValidationErrors } from \"@/util/Forms\";\r\nimport ResetPasswordMachine from \"./ResetPasswordMachine\";\r\n\r\ninterface PasswordResetForm {\r\n valid: boolean;\r\n errors: {};\r\n fields: {\r\n passwordResetToken: string;\r\n password: string;\r\n passwordRepeat: string;\r\n };\r\n validations: {};\r\n}\r\n\r\nconst Component = defineComponent({\r\n setup(props, vm) {\r\n const password = ref(\"\");\r\n const passwordRepeat = ref(\"\");\r\n\r\n const { state, send, service } = useMachine(ResetPasswordMachine);\r\n const api = new AuthenticationApi();\r\n\r\n const form: PasswordResetForm = reactive({\r\n valid: false,\r\n\r\n fields: {\r\n passwordResetToken: \"\",\r\n password,\r\n passwordRepeat,\r\n },\r\n\r\n errors: {},\r\n\r\n validations: useVuelidate(\r\n {\r\n password: {\r\n required,\r\n password: isPassword,\r\n $autoDirty: true,\r\n },\r\n passwordRepeat: {\r\n required,\r\n sameAs: sameAs(password),\r\n $autoDirty: true,\r\n },\r\n },\r\n {\r\n password,\r\n passwordRepeat,\r\n }\r\n ),\r\n });\r\n\r\n async function verifyResetToken(passwordResetToken: string) {\r\n try {\r\n await api.authenticationIsPasswordResetTokenValid({\r\n passwordResetToken,\r\n });\r\n form.fields.passwordResetToken = passwordResetToken;\r\n service.send(\"RESOLVE\");\r\n } catch (err) {\r\n service.send(\"REJECT\");\r\n }\r\n }\r\n\r\n async function passwordReset() {\r\n try {\r\n await api.authenticationResetPassword({\r\n passwordResetToken: form.fields.passwordResetToken,\r\n password: form.fields.password,\r\n });\r\n service.send(\"RESOLVE\");\r\n } catch (err) {\r\n form.errors = err.response.data.errors;\r\n service.send(\"REJECT\");\r\n }\r\n }\r\n\r\n onMounted(() => {\r\n if (vm.root.$route.params.token) {\r\n verifyResetToken(vm.root.$route.params.token);\r\n } else {\r\n service.send(\"REJECT\");\r\n }\r\n\r\n service.subscribe((s) => {\r\n if (s.matches(\"loading\")) {\r\n passwordReset();\r\n }\r\n });\r\n });\r\n\r\n return {\r\n form,\r\n mapValidationErrors,\r\n service,\r\n send,\r\n state,\r\n };\r\n },\r\n});\r\n\r\nexport default Component;\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/vuetify-loader/lib/loader.js??ref--20-0!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ResetPassword.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/vuetify-loader/lib/loader.js??ref--20-0!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ResetPassword.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ResetPassword.vue?vue&type=template&id=461f365c&\"\nimport script from \"./ResetPassword.vue?vue&type=script&lang=ts&\"\nexport * from \"./ResetPassword.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardActions } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\nimport { VToolbar } from 'vuetify/lib/components/VToolbar';\nimport { VToolbarTitle } from 'vuetify/lib/components/VToolbar';\ninstallComponents(component, {VAlert,VBtn,VCard,VCardActions,VCardText,VForm,VSpacer,VTextField,VToolbar,VToolbarTitle})\n"],"sourceRoot":""}