/*! For license information please see oauth2-oauth2.js.LICENSE.txt */ !function(){"use strict";var e,n={62411:function(e,n,r){var i=r(20144),o=r(4820),a={name:"OAuthItem",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}}},l=r(93379),s=r.n(l),d=r(7795),c=r.n(d),u=r(90569),h=r.n(u),p=r(3565),m=r.n(p),f=r(19216),A=r.n(f),v=r(44589),g=r.n(v),C=r(72580),b={};b.styleTagTransform=g(),b.setAttributes=m(),b.insert=h().bind(null,"head"),b.domAPI=c(),b.insertStyleElement=A(),s()(C.Z,b),C.Z&&C.Z.locals&&C.Z.locals;var w=r(51900),y=(0,w.Z)(a,(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("span",[n("a",{staticClass:"icon-delete has-tooltip",attrs:{title:t.t("oauth2","Delete")},on:{click:function(e){return t.$emit("delete",t.id)}}})])])])}),[],!1,null,"665ff3f1",null).exports,_=r(79753),U={name:"App",components:{OAuthItem:y},props:{clients:{type:Array,required:!0}},data:function(){return{newClient:{name:"",redirectUri:"",errorMsg:"",error:!1}}},methods:{deleteClient:function(t){var e=this;o.default.delete((0,_.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,_.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}))}}},S=r(39720),x={};x.styleTagTransform=g(),x.setAttributes=m(),x.insert=h().bind(null,"head"),x.domAPI=c(),x.insertStyleElement=A(),s()(S.Z,x),S.Z&&S.Z.locals&&S.Z.locals;var O=(0,w.Z)(U,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"section",attrs:{id:"oauth2"}},[n("h2",[t._v(t._s(t.t("oauth2","OAuth 2.0 clients")))]),t._v(" "),n("p",{staticClass:"settings-hint"},[t._v("\n\t\t\t"+t._s(t.t("oauth2","OAuth 2.0 allows external services to request access to {instanceName}.",{instanceName:t.OC.theme.name}))+"\n\t\t")]),t._v(" "),t.clients.length>0?n("table",{staticClass:"grid"},[t._m(0),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("input",{staticClass:"button",attrs:{type:"submit"},domProps:{value:t.t("oauth2","Add")}})])])}),[function(){var t=this,e=t.$createElement,n=t._self._c||e;return 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")])])])}],!1,null,"7098866e",null),I=O.exports,R=r(16453);i.default.prototype.t=t,i.default.prototype.OC=OC;var N=(0,R.loadState)("oauth2","clients");new(i.default.extend(I))({propsData:{clients:N}}).$mount("#oauth2")},39720:function(t,e,n){var r=n(87537),i=n.n(r),o=n(23645),a=n.n(o)()(i());a.push([t.id,"\ntable[data-v-7098866e] {\n\tmax-width: 800px;\n}\n","",{version:3,sources:["webpack://./apps/oauth2/src/App.vue"],names:[],mappings:";AAyHA;CACA,gBAAA;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