(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{2710:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(a(281)),n=h(a(280)),l=h(a(282)),o=h(a(284)),s=h(a(283)),i=h(a(1)),u=h(a(3)),d=a(764),c=a(788),m=h(a(980)),p=h(a(814)),f=a(289);function h(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function t(e){(0,n.default)(this,t);var a=(0,l.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,s.default)(t,e),(0,o.default)(t,null,[{key:"propTypes",get:function(){return{location:i.default.object.isRequired,params:i.default.object.isRequired}}}]),(0,o.default)(t,[{key:"UNSAFE_componentWillMount",value:function(){var e=this,t=new URLSearchParams(this.props.location.search).get("client_id");/^[a-z0-9]+$/.test(t)&&(0,c.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,c.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");e.startsWith("https://")||e.startsWith("http://")?window.location.href=e+"?error=access_denied":f.browserHistory.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:m.default;var a=void 0;return this.state.error&&(a=u.default.createElement("div",{className:"prompt__error form-group"},u.default.createElement(p.default,{error:this.state.error}))),u.default.createElement("div",{className:"container-fluid"},u.default.createElement("div",{className:"prompt"},u.default.createElement("div",{className:"prompt__heading"},u.default.createElement("div",{className:"prompt__app-icon"},u.default.createElement("img",{src:t,width:"50",height:"50",alt:""})),u.default.createElement("div",{className:"text"},u.default.createElement(d.FormattedHTMLMessage,{id:"authorize.title",defaultMessage:"<strong>{appName}</strong> would like to connect to your <strong>Mattermost</strong> user account",values:{appName:e.name}}))),u.default.createElement("p",null,u.default.createElement(d.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}})),u.default.createElement("h2",{className:"prompt__allow"},u.default.createElement(d.FormattedHTMLMessage,{id:"authorize.access",defaultMessage:"Allow <strong>{appName}</strong> access?",values:{appName:e.name}})),u.default.createElement("div",{className:"prompt__buttons"},u.default.createElement("button",{type:"submit",className:"btn btn-link authorize-btn",onClick:this.handleDeny},u.default.createElement(d.FormattedMessage,{id:"authorize.deny",defaultMessage:"Deny"})),u.default.createElement("button",{type:"submit",className:"btn btn-primary authorize-btn",onClick:this.handleAllow},u.default.createElement(d.FormattedMessage,{id:"authorize.allow",defaultMessage:"Allow"}))),a))}}]),t}(u.default.Component);t.default=v}}]);
//# sourceMappingURL=27.4e989d340e9d2cf5338c.js.map