webpackJsonp([19],{1529:function(e,t,a){t=e.exports=a(3)(void 0),t.push([e.i,".login-grid{margin:0!important;height:100%}.login-grid .column{max-width:650px;width:95%!important}",""])},1619:function(e,t,a){var n=a(1529);"string"==typeof n&&(n=[[e.i,n,""]]);var i={};i.transform=void 0,a(4)(n,i),n.locals&&(e.exports=n.locals)},874:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(1),i=a.n(n),l=a(0),o=a.n(l),r=a(8),s=a.n(r),c=a(99),u=a(26),m=a(126),d=a(58),p=a(1619),g=(a.n(p),function(e){var t=e.lastError;return null===t?null:o.a.createElement(m.a,{isError:!0,description:"Authentication failed: "+t})}),f=function(e){var t=e.onSubmit,a=e.loading;return e.allowLogin?a?o.a.createElement(d.a,{size:"small",inline:!0,text:""}):o.a.createElement("input",{className:"ui button fluid large submit",value:"Login",type:"submit",onClick:t}):null},h=function(){return null},E=o.a.createClass({displayName:"Login",mixins:[s.a.connect(u.a,"login")],contextTypes:{router:i.a.object},getInitialState:function(){return{loading:!1}},componentWillUpdate:function(e,t){if(t.login.socketAuthenticated){var a=this.props.location.state?this.props.location.state.nextPath:"/";this.context.router.replace({pathname:a})}else this.state.loading&&null!==t.login.lastError&&this.setState({loading:!1})},_onKeyDown:function(e){13===e.keyCode&&this.onSubmit(e)},onSubmit:function(e){var t=this.username.value,a=this.password.value;e.preventDefault(),""!==t&&""!==a&&(c.a.login(t,a),this.setState({loading:!0}))},render:function(){var e=this;return o.a.createElement("div",{className:"ui middle aligned center aligned grid login-grid"},o.a.createElement("div",{className:"column"},o.a.createElement("form",{className:"ui large form",onKeyDown:this._onKeyDown,autoComplete:"on"},o.a.createElement("div",{className:"ui stacked segment"},o.a.createElement("div",{className:"field"},o.a.createElement("div",{className:"ui left icon input"},o.a.createElement("i",{className:"user icon"}),o.a.createElement("input",{type:"text",name:"username",placeholder:"Username",ref:function(t){return e.username=t},autoFocus:!0}))),o.a.createElement("div",{className:"field"},o.a.createElement("div",{className:"ui left icon input"},o.a.createElement("i",{className:"lock icon"}),o.a.createElement("input",{className:"password",name:"password",placeholder:"Password",ref:function(t){return e.password=t},type:"password"}))),o.a.createElement(f,{onSubmit:this.onSubmit,loading:this.state.loading,allowLogin:u.a.allowLogin})),o.a.createElement(h,null)),o.a.createElement(g,{userLoggedIn:u.a.hasSession,lastError:u.a.lastError})))}});t.default=E}});
//# sourceMappingURL=login.de5e5d769605c5cd768e.chunk.js.map