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