exports.ids = [47];
exports.modules = {

/***/ 149:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/user_confirm/_code.vue?vue&type=template&id=c8a41e78&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',[_c('v-row',{staticClass:"mt-5",attrs:{"align":"center","justify":"center"}},[_c('v-col',{attrs:{"cols":"12","md":"6","lg":"5","xl":"4"}},[_c('v-card',[_c('v-card-title',[_vm._v(_vm._s(_vm.$t('common.set_password')))]),(_vm.user)?[_c('v-card-subtitle',[_vm._v(_vm._s(_vm.user.email))]),_c('v-card-text',[_c('v-form',[_c('v-text-field',{attrs:{"type":"password","label":_vm.$t('common.new_password'),"rules":_vm.$validators.password,"autofocus":""},model:{value:(_vm.new_password),callback:function ($$v) {_vm.new_password=$$v},expression:"new_password"}})],1)],1),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"text":"","color":"primary","disabled":!_vm.new_password},on:{"click":_vm.change_password}},[_vm._v(_vm._s(_vm.$t('common.send')))])],1)]:_c('v-card-text',[_c('v-alert',{staticClass:"ma-5",attrs:{"type":"error"}},[_vm._v(_vm._s(_vm.$t('recover.not_valid_code')))])],1)],2)],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/user_confirm/_code.vue?vue&type=template&id=c8a41e78&lang=pug&

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/user_confirm/_code.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var _codevue_type_script_lang_js_ = ({
  name: 'Recover',

  async asyncData({
    params,
    $axios
  }) {
    const code = params.code;

    try {
      const user = await $axios.$post('/user/check_recover_code', {
        recover_code: code
      });
      return {
        user,
        code
      };
    } catch (e) {
      return {
        user: false
      };
    }
  },

  data() {
    return {
      new_password: ''
    };
  },

  methods: {
    async change_password() {
      try {
        await this.$axios.$post('/user/recover_password', {
          recover_code: this.code,
          password: this.new_password
        });
        this.$root.$message('common.password_updated', {
          color: 'success'
        });
        this.$router.replace('/login');
      } catch (e) {
        this.$root.$message(e, {
          color: 'warning'
        });
      }
    }

  }
});
// CONCATENATED MODULE: ./pages/user_confirm/_code.vue?vue&type=script&lang=js&
 /* harmony default export */ var user_confirm_codevue_type_script_lang_js_ = (_codevue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./pages/user_confirm/_code.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  user_confirm_codevue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "168c1926"
  
)

/* harmony default export */ var _code = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=_code.js.map