exports.ids = [24];
exports.modules = {

/***/ 111:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(125);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(6).default
module.exports.__inject__ = function (context) {
  add("419b9f89", content, true, context)
};

/***/ }),

/***/ 124:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Authorize_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(111);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Authorize_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Authorize_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Authorize_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Authorize_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 125:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(5);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, "h4 img{max-height:40px;border-radius:20px;background-color:#333;border:1px solid #333}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

/***/ 137:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/Authorize.vue?vue&type=template&id=a849b402&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"d-flex justify-space-around"},[_c('v-card',{staticClass:"mt-5",attrs:{"max-width":"600px"}},[_c('v-card-title',[_vm._v(_vm._s(_vm.settings.title)+" - "+_vm._s(_vm.$t('common.authorize')))]),_c('v-card-text',[_c('u',[_vm._v(_vm._s(_vm.$auth.user.email))]),_c('div',[_c('p',{domProps:{"innerHTML":_vm._s(_vm.$t('oauth.authorization_request', { app: _vm.client.name, instance_name: _vm.settings.title }))}}),_c('ul',{staticClass:"mb-2"},_vm._l((_vm.scope.split(' ')),function(s){return _c('li',[_vm._v(_vm._s(_vm.$t(("oauth.scopes." + _vm.scope))))])}),0),_c('span',{domProps:{"innerHTML":_vm._s(_vm.$t('oauth.redirected_to', {url: _vm.$route.query.redirect_uri}))}})])]),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"color":"error","to":"/"}},[_vm._v(_vm._s(_vm.$t('common.cancel')))]),_c('v-btn',{attrs:{"href":_vm.authorizeURL,"color":"success"}},[_vm._v(_vm._s(_vm.$t('common.authorize')))])],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/Authorize.vue?vue&type=template&id=a849b402&lang=pug&

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/Authorize.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var Authorizevue_type_script_lang_js_ = ({
  name: 'Authorize',
  layout: 'modal',
  middleware: ['auth'],

  async asyncData({
    $axios,
    query,
    error,
    req
  }) {
    const {
      client_id,
      redirect_uri,
      scope,
      response_type
    } = query;
    let err = '';

    if (!client_id) {
      err = 'client_id is missing';
    }

    if (!redirect_uri) {
      err = 'redirect_uri is missing';
    }

    if (!scope || scope !== 'event:write') {
      err = 'scope is missing or wrong';
    }

    if (!response_type || response_type !== 'code') {
      err = 'response_type is missing or wrong';
    } // retrieve client validity


    try {
      const client = await $axios.$get(`/client/${client_id}`);

      if (!client) {
        err = 'client not found';
      }

      if (err) {
        return error({
          statusCode: 404,
          message: err
        });
      }

      return {
        client,
        redirect_uri,
        scope,
        response_type
      };
    } catch (e) {
      error({
        statusCode: 400,
        message: 'Something goes wrong with OAuth authorization'
      });
    }
  },

  data() {
    return {
      client: {
        name: 'Test'
      }
    };
  },

  computed: { ...Object(external_vuex_["mapState"])(['settings']),

    authorizeURL() {
      const {
        scope,
        response_type,
        client_id,
        redirect_uri,
        state
      } = this.$route.query;
      const query = `client_id=${client_id}&response_type=${response_type}&scope=${scope}&redirect_uri=${redirect_uri}&state=${state}`;
      return `oauth/authorize?${query}`;
    }

  },

  head() {
    return {
      title: `${this.settings.title} - Authorize`
    };
  }

});
// CONCATENATED MODULE: ./pages/Authorize.vue?vue&type=script&lang=js&
 /* harmony default export */ var pages_Authorizevue_type_script_lang_js_ = (Authorizevue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./pages/Authorize.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(124)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  pages_Authorizevue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  injectStyles,
  null,
  "a560f756"
  
)

/* harmony default export */ var Authorize = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=Authorize.js.map