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

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

"use strict";
/* WEBPACK VAR INJECTION */(function(URLSearchParams) {/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vuex__WEBPACK_IMPORTED_MODULE_0__);
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ __webpack_exports__["a"] = ({
  name: 'Login',

  data() {
    return {
      password: '',
      email: '',
      loading: false,
      valid: false
    };
  },

  computed: { ...Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapState"])(['settings'])
  },
  methods: {
    async forgot() {
      if (!this.email) {
        //   this.$root.$message({ message: this.$t('login.insert_email'), color: 'error' })
        this.$refs.email.focus();
        return;
      }

      this.loading = true;
      await this.$axios.$post('/user/recover', {
        email: this.email
      });
      this.loading = false;
      this.$root.$message('login.check_email', {
        color: 'success'
      });
    },

    async submit(e) {
      if (!this.$refs.form.validate()) return;

      try {
        this.loading = true;
        const data = new URLSearchParams();
        data.append('username', this.email);
        data.append('password', this.password);
        data.append('grant_type', 'password');
        data.append('client_id', 'self');
        await this.$auth.loginWith('local', {
          data
        });
        this.loading = false;
        this.$root.$message('login.ok', {
          color: 'success'
        });
      } catch (e) {
        this.$root.$message('login.error', {
          color: 'error'
        });
        this.loading = false;
        return;
      }

      this.email = this.password = '';
    }

  },

  head() {
    return {
      title: this.settings.title + ' - ' + this.$t('common.login')
    };
  }

});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(62)["URLSearchParams"]))

/***/ }),

/***/ 150:
/***/ (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/Login.vue?vue&type=template&id=67636228&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-form',{ref:"form",attrs:{"lazy-validation":""},on:{"submit":function($event){$event.preventDefault();return _vm.submit.apply(null, arguments)}},model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:"valid"}},[_c('v-card',[_c('v-card-title',[_vm._v(_vm._s(_vm.$t('common.login')))]),_c('v-card-subtitle',{domProps:{"textContent":_vm._s(_vm.$t('login.description'))}}),_c('v-card-text',[_c('v-text-field',{ref:"email",attrs:{"type":"email","validate-on-blur":"","rules":_vm.$validators.email,"autofocus":"","label":_vm.$t("common.email")},model:{value:(_vm.email),callback:function ($$v) {_vm.email=$$v},expression:"email"}}),_c('v-text-field',{attrs:{"rules":_vm.$validators.password,"type":"password","label":_vm.$t("common.password")},model:{value:(_vm.password),callback:function ($$v) {_vm.password=$$v},expression:"password"}})],1),_c('v-card-actions',[_c('v-btn',{attrs:{"text":"","tabindex":"1","small":""},on:{"click":_vm.forgot}},[_vm._v(_vm._s(_vm.$t('login.forgot_password')))])],1),_c('v-card-actions',[_c('v-spacer'),(_vm.settings.allow_registration)?_c('v-btn',{attrs:{"to":"/register","text":"","color":"orange"}},[_vm._v(_vm._s(_vm.$t('login.not_registered')))]):_vm._e(),_c('v-btn',{attrs:{"color":"success","type":"submit","disabled":!_vm.valid || _vm.loading,"loading":_vm.loading}},[_vm._v(_vm._s(_vm.$t('common.login')))])],1)],1)],1)],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/Login.vue?vue&type=template&id=67636228&lang=pug&

// EXTERNAL 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/Login.vue?vue&type=script&lang=js&
var Loginvue_type_script_lang_js_ = __webpack_require__(103);

// CONCATENATED MODULE: ./pages/Login.vue?vue&type=script&lang=js&
 /* harmony default export */ var pages_Loginvue_type_script_lang_js_ = (Loginvue_type_script_lang_js_["a" /* default */]); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./pages/Login.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  pages_Loginvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "1ab9f5d5"
  
)

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

/***/ })

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