(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{554:function(t,e,o){"use strict";o.r(e);var r=o(3),n=o(11),l=(o(15),o(20),o(184),o(13));function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(object);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,o)}return e}var d={name:"Login",data:()=>({password:"",email:"",loading:!1,valid:!1}),computed:function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(n.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},Object(l.c)(["settings"])),methods:{forgot(){var t=this;return Object(r.a)((function*(){t.email?(t.loading=!0,yield t.$axios.$post("/user/recover",{email:t.email}),t.loading=!1,t.$root.$message("login.check_email",{color:"success"})):t.$refs.email.focus()}))()},submit(t){var e=this;return Object(r.a)((function*(){if(e.$refs.form.validate()){try{e.loading=!0;var data=new URLSearchParams;data.append("username",e.email),data.append("password",e.password),data.append("grant_type","password"),data.append("client_id","self"),yield e.$auth.loginWith("local",{data:data}),e.loading=!1,e.$root.$message("login.ok",{color:"success"})}catch(t){return e.$root.$message("login.error",{color:"error"}),void(e.loading=!1)}e.email=e.password=""}}))()}},head(){return{title:this.settings.title+" - "+this.$t("common.login")}}},m=d,v=o(6),component=Object(v.a)(m,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-container",[o("v-row",{staticClass:"mt-5",attrs:{align:"center",justify:"center"}},[o("v-col",{attrs:{cols:"12",md:"6",lg:"5",xl:"4"}},[o("v-form",{ref:"form",attrs:{"lazy-validation":""},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[o("v-card",[o("v-card-title",[t._v(t._s(t.$t("common.login")))]),o("v-card-subtitle",{domProps:{textContent:t._s(t.$t("login.description"))}}),o("v-card-text",[o("v-text-field",{ref:"email",attrs:{type:"email","validate-on-blur":"",rules:t.$validators.email,autofocus:"",label:t.$t("common.email")},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}}),o("v-text-field",{attrs:{rules:t.$validators.password,type:"password",label:t.$t("common.password")},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}})],1),o("v-card-actions",[o("v-btn",{attrs:{text:"",tabindex:"1",small:""},on:{click:t.forgot}},[t._v(t._s(t.$t("login.forgot_password")))])],1),o("v-card-actions",[o("v-spacer"),t.settings.allow_registration?o("v-btn",{attrs:{to:"/register",text:"",color:"orange"}},[t._v(t._s(t.$t("login.not_registered")))]):t._e(),o("v-btn",{attrs:{color:"success",type:"submit",disabled:!t.valid||t.loading,loading:t.loading}},[t._v(t._s(t.$t("common.login")))])],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);