webpackJsonp([26],{2577:function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=a(259),n=l(r),o=a(258),s=l(o),i=a(260),u=l(i),d=a(262),c=l(d),m=a(261),p=l(m),f=a(22),h=l(f),v=a(14),g=l(v),_=a(749),w=a(789),y=a(1018),b=l(y),E=a(810),M=l(E),N=function(e){function t(e){(0,s.default)(this,t);var a=(0,u.default)(this,(t.__proto__||(0,n.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=new URLSearchParams(this.props.location.search).get("client_id");/^[a-z0-9]+$/.test(t)&&(0,w.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=new URLSearchParams(this.props.location.search);(0,w.allowOAuth2)(t,function(e){e.redirect&&(window.location.href=e.redirect)},function(t){e.setState({error:t.message})})}},{key:"handleDeny",value:function(){var e=new URLSearchParams(this.props.location.search).get("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:b.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(_.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(_.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(_.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(_.FormattedMessage,{id:"authorize.deny",defaultMessage:"Deny"})),g.default.createElement("button",{type:"submit",className:"btn btn-primary authorize-btn",onClick:this.handleAllow},g.default.createElement(_.FormattedMessage,{id:"authorize.allow",defaultMessage:"Allow"}))),a))}}]),t}(g.default.Component);t.default=N}});
//# sourceMappingURL=26.e98858ae9ef969430904.js.map