/*! For license information please see oauth2-oauth2.js.LICENSE.txt */ !function(){"use strict";var e,n={32340:function(e,n,i){var r=i(20144),o=i(4820),a=i(33691),l=i(10861),s=i.n(l),c={name:"OAuthItem",components:{Delete:a.Z,NcButton:s()},props:{client:{type:Object,required:!0}},data:function(){return{id:this.client.id,name:this.client.name,redirectUri:this.client.redirectUri,clientId:this.client.clientId,clientSecret:this.client.clientSecret,renderSecret:!1}},computed:{renderedSecret:function(){return this.renderSecret?this.clientSecret:"****"}},methods:{toggleSecret:function(){this.renderSecret=!this.renderSecret}}},d=i(93379),u=i.n(d),h=i(7795),p=i.n(h),m=i(90569),A=i.n(m),f=i(3565),v=i.n(f),g=i(19216),b=i.n(g),C=i(44589),w=i.n(C),y=i(14737),S={};S.styleTagTransform=w(),S.setAttributes=v(),S.insert=A().bind(null,"head"),S.domAPI=p(),S.insertStyleElement=b(),u()(y.Z,S),y.Z&&y.Z.locals&&y.Z.locals;var x=i(51900),_=(0,x.Z)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("tr",[n("td",[n("table",{staticClass:"inline"},[n("tr",[n("td",[t._v(t._s(t.t("oauth2","Name")))]),t._v(" "),n("td",[t._v(t._s(t.name))])]),t._v(" "),n("tr",[n("td",[t._v(t._s(t.t("oauth2","Redirection URI")))]),t._v(" "),n("td",[t._v(t._s(t.redirectUri))])]),t._v(" "),n("tr",[n("td",[t._v(t._s(t.t("oauth2","Client Identifier")))]),t._v(" "),n("td",[n("code",[t._v(t._s(t.clientId))])])]),t._v(" "),n("tr",[n("td",[t._v(t._s(t.t("oauth2","Secret")))]),t._v(" "),n("td",[n("code",[t._v(t._s(t.renderedSecret))]),n("a",{staticClass:"icon-toggle has-tooltip",attrs:{title:t.t("oauth2","Show client secret")},on:{click:t.toggleSecret}})])])])]),t._v(" "),n("td",{staticClass:"action-column"},[n("NcButton",{attrs:{type:"tertiary-no-background","aria-label":t.t("oauth2","Delete")},on:{click:function(e){return t.$emit("delete",t.id)}},scopedSlots:t._u([{key:"icon",fn:function(){return[n("Delete",{attrs:{size:20,title:t.t("oauth2","Delete")}})]},proxy:!0}])})],1)])}),[],!1,null,"75e22bc6",null).exports,N=i(79753),U=i(42515),O=i(13299),I=i.n(O),R=i(16453),k={name:"App",components:{OAuthItem:_,NcSettingsSection:I(),NcButton:s()},props:{clients:{type:Array,required:!0}},data:function(){return{newClient:{name:"",redirectUri:"",errorMsg:"",error:!1},oauthDocLink:(0,R.loadState)("oauth2","oauth2-doc-link")}},computed:{instanceName:function(){return(0,U.getCapabilities)().theming.name}},methods:{deleteClient:function(t){var e=this;o.default.delete((0,N.generateUrl)("apps/oauth2/clients/{id}",{id:t})).then((function(n){e.clients=e.clients.filter((function(e){return e.id!==t}))}))},addClient:function(){var t=this;this.newClient.error=!1,o.default.post((0,N.generateUrl)("apps/oauth2/clients"),{name:this.newClient.name,redirectUri:this.newClient.redirectUri}).then((function(e){t.clients.push(e.data),t.newClient.name="",t.newClient.redirectUri=""})).catch((function(e){t.newClient.error=!0,t.newClient.errorMsg=e.response.data.message}))}}},T=i(80866),P={};P.styleTagTransform=w(),P.setAttributes=v(),P.insert=A().bind(null,"head"),P.domAPI=p(),P.insertStyleElement=b(),u()(T.Z,P),T.Z&&T.Z.locals&&T.Z.locals;var B=(0,x.Z)(k,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NcSettingsSection",{attrs:{title:t.t("oauth2","OAuth 2.0 clients"),description:t.t("oauth2","OAuth 2.0 allows external services to request access to {instanceName}.",{instanceName:t.instanceName}),"doc-url":t.oauthDocLink}},[t.clients.length>0?n("table",{staticClass:"grid"},[n("thead",[n("tr",[n("th",{attrs:{id:"headerContent"}}),t._v(" "),n("th",{attrs:{id:"headerRemove"}},[t._v("\n \n\t\t\t\t\t")])])]),t._v(" "),n("tbody",t._l(t.clients,(function(e){return n("OAuthItem",{key:e.id,attrs:{client:e},on:{delete:t.deleteClient}})})),1)]):t._e(),t._v(" "),n("br"),t._v(" "),n("h3",[t._v(t._s(t.t("oauth2","Add client")))]),t._v(" "),t.newClient.error?n("span",{staticClass:"msg error"},[t._v(t._s(t.newClient.errorMsg))]):t._e(),t._v(" "),n("form",{on:{submit:function(e){return e.preventDefault(),t.addClient.apply(null,arguments)}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newClient.name,expression:"newClient.name"}],attrs:{id:"name",type:"text",name:"name",placeholder:t.t("oauth2","Name")},domProps:{value:t.newClient.name},on:{input:function(e){e.target.composing||t.$set(t.newClient,"name",e.target.value)}}}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.newClient.redirectUri,expression:"newClient.redirectUri"}],attrs:{id:"redirectUri",type:"url",name:"redirectUri",placeholder:t.t("oauth2","Redirection URI")},domProps:{value:t.newClient.redirectUri},on:{input:function(e){e.target.composing||t.$set(t.newClient,"redirectUri",e.target.value)}}}),t._v(" "),n("NcButton",{staticClass:"inline-button"},[t._v("\n\t\t\t\t"+t._s(t.t("oauth2","Add"))+"\n\t\t\t")])],1)])}),[],!1,null,"d929f2ba",null),D=B.exports;r.ZP.prototype.t=t,r.ZP.prototype.OC=OC;var L=(0,R.loadState)("oauth2","clients");new(r.ZP.extend(D))({propsData:{clients:L}}).$mount("#oauth2")},80866:function(t,e,n){var i=n(87537),r=n.n(i),o=n(23645),a=n.n(o)()(r());a.push([t.id,"\ntable[data-v-d929f2ba] {\n\tmax-width: 800px;\n}\n\n/** Overwrite button height and position to be aligned with the text input */\n.inline-button[data-v-d929f2ba] {\n\tmin-height: 34px !important;\n\tdisplay: inline-flex !important;\n}\n","",{version:3,sources:["webpack://./apps/oauth2/src/App.vue"],names:[],mappings:";AAqIA;CACA,gBAAA;AACA;;AAEA,4EAAA;AACA;CACA,2BAAA;CACA,+BAAA;AACA",sourcesContent:["\x3c!--\n - @copyright Copyright (c) 2018 Roeland Jago Douma \n -\n - @author Roeland Jago Douma \n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see .\n -\n --\x3e\n\n\n