(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{485:function(t,e,r){var content=r(554);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(64).default)("419b9f89",content,!0,{sourceMap:!1})},553:function(t,e,r){"use strict";r(485)},554:function(t,e,r){var n=r(63)(!1);n.push([t.i,"h4 img{max-height:40px;border-radius:20px;background-color:#333;border:1px solid #333}",""]),t.exports=n},602:function(t,e,r){"use strict";r.r(e);r(32),r(27),r(24),r(9),r(45),r(31),r(46);var n=r(16),o=r(3),c=(r(37),r(26),r(20));function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function d(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(n.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var f={name:"Authorize",layout:"modal",middleware:["auth"],asyncData:function(t){return Object(o.a)(regeneratorRuntime.mark((function e(){var r,n,o,c,l,d,f,_,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.$axios,n=t.query,o=t.error,t.req,c=n.client_id,l=n.redirect_uri,d=n.scope,f=n.response_type,_="",c||(_="client_id is missing"),l||(_="redirect_uri is missing"),d&&"event:write"===d||(_="scope is missing or wrong"),f&&"code"===f||(_="response_type is missing or wrong"),e.prev=7,e.next=10,r.$get("/client/".concat(c));case 10:if((h=e.sent)||(_="client not found"),!_){e.next=14;break}return e.abrupt("return",o({statusCode:404,message:_}));case 14:return e.abrupt("return",{client:h,redirect_uri:l,scope:d,response_type:f});case 17:e.prev=17,e.t0=e.catch(7),o({statusCode:400,message:"Something goes wrong with OAuth authorization"});case 20:case"end":return e.stop()}}),e,null,[[7,17]])})))()},data:function(){return{client:{name:"Test"}}},computed:d(d({},Object(c.c)(["settings"])),{},{authorizeURL:function(){var t=this.$route.query,e=t.scope,r=t.response_type,n=t.client_id,o=t.redirect_uri,c=t.state,l="client_id=".concat(n,"&response_type=").concat(r,"&scope=").concat(e,"&redirect_uri=").concat(o,"&state=").concat(c);return"oauth/authorize?".concat(l)}}),head:function(){return{title:"".concat(this.settings.title," - Authorize")}}},_=(r(553),r(11)),component=Object(_.a)(f,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"d-flex justify-space-around"},[r("v-card",{staticClass:"mt-5",attrs:{"max-width":"600px"}},[r("v-card-title",[t._v(t._s(t.settings.title)+" - "+t._s(t.$t("common.authorize")))]),r("v-card-text",[r("u",[t._v(t._s(t.$auth.user.email))]),r("div",[r("p",{domProps:{innerHTML:t._s(t.$t("oauth.authorization_request",{app:t.client.name,instance_name:t.settings.title}))}}),r("ul",{staticClass:"mb-2"},t._l(t.scope.split(" "),(function(s){return r("li",[t._v(t._s(t.$t("oauth.scopes."+t.scope)))])})),0),r("span",{domProps:{innerHTML:t._s(t.$t("oauth.redirected_to",{url:t.$route.query.redirect_uri}))}})])]),r("v-card-actions",[r("v-spacer"),r("v-btn",{attrs:{color:"error",to:"/"}},[t._v(t._s(t.$t("common.cancel")))]),r("v-btn",{attrs:{href:t.authorizeURL,color:"success"}},[t._v(t._s(t.$t("common.authorize")))])],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);