webpackJsonp([20],{1162:function(e,t,a){t=e.exports=a(2)(),t.push([e.i,".login-grid{margin:0!important;height:100%}.login-grid .column{max-width:650px;width:95%!important}",""])},1340:[782,1162],753:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(7),o=a.n(l),r=a(68),s=a(27),c=a(118),u=a(65),m=a(1340),d=(a.n(m),function(e){var t=e.lastError;return null===t?null:i.a.createElement(c.a,{isError:!0,description:"Authentication failed: "+t})}),p=function(e){var t=e.onSubmit,a=e.loading,n=e.allowLogin;return n?a?i.a.createElement(u.a,{size:"small",inline:!0,text:""}):i.a.createElement("input",{className:"ui button fluid large submit",value:"Login",type:"submit",onClick:t}):null},g=function(){return null},f=13,h=i.a.createClass({displayName:"Login",mixins:[o.a.connect(s.a,"login")],contextTypes:{router:i.a.PropTypes.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){e.keyCode===f&&this.onSubmit(e)},onSubmit:function(e){var t=this.refs.username.value,a=this.refs.password.value;e.preventDefault(),""!==t&&""!==a&&(r.a.login(t,a),this.setState({loading:!0}))},render:function(){return i.a.createElement("div",{className:"ui middle aligned center aligned grid login-grid"},i.a.createElement("div",{className:"column"},i.a.createElement("form",{className:"ui large form",onKeyDown:this._onKeyDown,autoComplete:"on"},i.a.createElement("div",{className:"ui stacked segment"},i.a.createElement("div",{className:"field"},i.a.createElement("div",{className:"ui left icon input"},i.a.createElement("i",{className:"user icon"}),i.a.createElement("input",{type:"text",name:"username",placeholder:"Username",ref:"username",autoFocus:!0}))),i.a.createElement("div",{className:"field"},i.a.createElement("div",{className:"ui left icon input"},i.a.createElement("i",{className:"lock icon"}),i.a.createElement("input",{className:"password",name:"password",placeholder:"Password",ref:"password",type:"password"}))),i.a.createElement(p,{onSubmit:this.onSubmit,loading:this.state.loading,allowLogin:s.a.allowLogin})),i.a.createElement(g,null)),i.a.createElement(d,{userLoggedIn:s.a.isLoggedIn,lastError:s.a.lastError})))}});t["default"]=h}});
//# sourceMappingURL=login.chunk.js.map