webpackJsonp([59],{2169:function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=a(6),r=l(n),o=a(4),i=l(o),s=a(7),u=l(s),d=a(5),c=l(d),m=a(8),p=l(m),f=a(2),h=l(f),v=a(1),g=l(v),y=a(17),_=a(742),b=a(757),w=l(b),E=a(239),M=l(E),N=function(e){function t(e){(0,i.default)(this,t);var a=(0,u.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e));return a.handleAllow=a.handleAllow.bind(a),a.handleDeny=a.handleDeny.bind(a),a.state={},a}return(0,p.default)(t,e),(0,c.default)(t,null,[{key:"propTypes",get:function(){return{location:h.default.object.isRequired,params:h.default.object.isRequired}}}]),(0,c.default)(t,[{key:"componentWillMount",value:function(){var e=this,t=this.props.location.query.client_id;/^[a-z0-9]+$/.test(t)&&(0,_.getOAuthAppInfo)(t,function(t){e.setState({app:t})})}},{key:"componentDidMount",value:function(){var e=document.getElementById("antiClickjack");e&&e.parentNode.removeChild(e)}},{key:"handleAllow",value:function(){var e=this,t=this.props.location.query;(0,_.allowOAuth2)(t,function(e){e.redirect&&(window.location.href=e.redirect)},function(t){e.setState({error:t.message})})}},{key:"handleDeny",value:function(){var e=this.props.location.query.redirect_uri;if(e.startsWith("https://")||e.startsWith("http://"))return void window.location.replace(e+"?error=access_denied");window.location.replace("/error")}},{key:"render",value:function(){var e=this.state.app;if(!e)return null;var t=void 0;t=e.icon_url?e.icon_url:w.default;var a=void 0;return this.state.error&&(a=g.default.createElement("div",{className:"prompt__error form-group"},g.default.createElement(M.default,{error:this.state.error}))),g.default.createElement("div",{className:"container-fluid"},g.default.createElement("div",{className:"prompt"},g.default.createElement("div",{className:"prompt__heading"},g.default.createElement("div",{className:"prompt__app-icon"},g.default.createElement("img",{src:t,width:"50",height:"50",alt:""})),g.default.createElement("div",{className:"text"},g.default.createElement(y.FormattedHTMLMessage,{id:"authorize.title",defaultMessage:"<strong>{appName}</strong> would like to connect to your <strong>Mattermost</strong> user account",values:{appName:e.name}}))),g.default.createElement("p",null,g.default.createElement(y.FormattedHTMLMessage,{id:"authorize.app",defaultMessage:"The app <strong>{appName}</strong> would like the ability to access and modify your basic information.",values:{appName:e.name}})),g.default.createElement("h2",{className:"prompt__allow"},g.default.createElement(y.FormattedHTMLMessage,{id:"authorize.access",defaultMessage:"Allow <strong>{appName}</strong> access?",values:{appName:e.name}})),g.default.createElement("div",{className:"prompt__buttons"},g.default.createElement("button",{type:"submit",className:"btn btn-link authorize-btn",onClick:this.handleDeny},g.default.createElement(y.FormattedMessage,{id:"authorize.deny",defaultMessage:"Deny"})),g.default.createElement("button",{type:"submit",className:"btn btn-primary authorize-btn",onClick:this.handleAllow},g.default.createElement(y.FormattedMessage,{id:"authorize.allow",defaultMessage:"Allow"}))),a))}}]),t}(g.default.Component);t.default=N}});
//# sourceMappingURL=59.33d7cfc09d38a8f20193.js.map