/*! For license information please see settings-vue-settings-admin-security.js.LICENSE.txt */ !function(){"use strict";var e,n={9310:function(e,n,o){var s=o(16453),r=o(20144),i=o(4820),a=o(7811),c=o.n(a),u=o(1412),d=o.n(u),l=o(7826),p=o.n(l),f=o(67776),h=o.n(f),g=o(96486),m=o.n(g),v=o(79753),w={name:"AdminTwoFactor",components:{Multiselect:c(),Button:d(),CheckboxRadioSwitch:p(),SettingsSection:h()},data:function(){return{loading:!1,dirty:!1,groups:[],loadingGroups:!1,twoFactorAdminDoc:(0,s.loadState)("settings","two-factor-admin-doc")}},computed:{enforced:{get:function(){return this.$store.state.enforced},set:function(t){this.dirty=!0,this.$store.commit("setEnforced",t)}},enforcedGroups:{get:function(){return this.$store.state.enforcedGroups},set:function(t){this.dirty=!0,this.$store.commit("setEnforcedGroups",t)}},excludedGroups:{get:function(){return this.$store.state.excludedGroups},set:function(t){this.dirty=!0,this.$store.commit("setExcludedGroups",t)}}},mounted:function(){this.groups=m().sortedUniq(m().uniq(this.enforcedGroups.concat(this.excludedGroups))),this.searchGroup("")},methods:{searchGroup:m().debounce((function(t){var e=this;this.loadingGroups=!0,i.default.get((0,v.generateOcsUrl)("cloud/groups?offset=0&search={query}&limit=20",{query:t})).then((function(t){return t.data.ocs})).then((function(t){return t.data.groups})).then((function(t){e.groups=m().sortedUniq(m().uniq(e.groups.concat(t)))})).catch((function(t){return console.error("could not search groups",t)})).then((function(){e.loadingGroups=!1}))}),500),saveChanges:function(){var t=this;this.loading=!0;var e={enforced:this.enforced,enforcedGroups:this.enforcedGroups,excludedGroups:this.excludedGroups};i.default.put((0,v.generateUrl)("/settings/api/admin/twofactorauth"),e).then((function(t){return t.data})).then((function(e){t.state=e,t.dirty=!1})).catch((function(t){console.error("could not save changes",t)})).then((function(){t.loading=!1}))}}},b=o(93379),x=o.n(b),y=o(7795),A=o.n(y),G=o(90569),C=o.n(G),S=o(3565),_=o.n(S),k=o(19216),E=o.n(k),O=o(44589),F=o.n(O),T=o(8496),q={};q.styleTagTransform=F(),q.setAttributes=_(),q.insert=C().bind(null,"head"),q.domAPI=A(),q.insertStyleElement=E(),x()(T.Z,q),T.Z&&T.Z.locals&&T.Z.locals;var $=(0,o(51900).Z)(w,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("SettingsSection",{attrs:{title:t.t("settings","Two-Factor Authentication"),description:t.t("settings","Two-factor authentication can be enforced for all users and specific groups. If they do not have a two-factor provider configured, they will be unable to log into the system."),"doc-url":t.twoFactorAdminDoc}},[t.loading?n("p",[n("span",{staticClass:"icon-loading-small two-factor-loading"}),t._v(" "),n("span",[t._v(t._s(t.t("settings","Enforce two-factor authentication")))])]):n("CheckboxRadioSwitch",{attrs:{id:"two-factor-enforced",checked:t.enforced,type:"switch"},on:{"update:checked":function(e){t.enforced=e}}},[t._v("\n\t\t"+t._s(t.t("settings","Enforce two-factor authentication"))+"\n\t")]),t._v(" "),t.enforced?[n("h3",[t._v(t._s(t.t("settings","Limit to groups")))]),t._v("\n\t\t"+t._s(t.t("settings","Enforcement of two-factor authentication can be set for certain groups only."))+"\n\t\t"),n("p",{staticClass:"top-margin"},[t._v("\n\t\t\t"+t._s(t.t("settings","Two-factor authentication is enforced for all members of the following groups."))+"\n\t\t")]),t._v(" "),n("p",[n("Multiselect",{attrs:{options:t.groups,placeholder:t.t("settings","Enforced groups"),disabled:t.loading,multiple:!0,searchable:!0,loading:t.loadingGroups,"show-no-options":!1,"close-on-select":!1},on:{"search-change":t.searchGroup},model:{value:t.enforcedGroups,callback:function(e){t.enforcedGroups=e},expression:"enforcedGroups"}})],1),t._v(" "),n("p",{staticClass:"top-margin"},[t._v("\n\t\t\t"+t._s(t.t("settings","Two-factor authentication is not enforced for members of the following groups."))+"\n\t\t")]),t._v(" "),n("p",[n("Multiselect",{attrs:{options:t.groups,placeholder:t.t("settings","Excluded groups"),disabled:t.loading,multiple:!0,searchable:!0,loading:t.loadingGroups,"show-no-options":!1,"close-on-select":!1},on:{"search-change":t.searchGroup},model:{value:t.excludedGroups,callback:function(e){t.excludedGroups=e},expression:"excludedGroups"}})],1),t._v(" "),n("p",{staticClass:"top-margin"},[n("em",[t._v("\n\t\t\t\t"+t._s(t.t("settings","When groups are selected/excluded, they use the following logic to determine if a user has 2FA enforced: If no groups are selected, 2FA is enabled for everyone except members of the excluded groups. If groups are selected, 2FA is enabled for all members of these. If a user is both in a selected and excluded group, the selected takes precedence and 2FA is enforced."))+"\n\t\t\t")])])]:t._e(),t._v(" "),n("p",{staticClass:"top-margin"},[t.dirty?n("Button",{attrs:{type:"primary",disabled:t.loading},on:{click:t.saveChanges}},[t._v("\n\t\t\t"+t._s(t.t("settings","Save changes"))+"\n\t\t")]):t._e()],1)],2)}),[],!1,null,"63855edf",null).exports,B=o(20629);r.default.use(B.ZP);var M={setEnforced:function(t,e){r.default.set(t,"enforced",e)},setEnforcedGroups:function(t,e){r.default.set(t,"enforcedGroups",e)},setExcludedGroups:function(t,e){r.default.set(t,"excludedGroups",e)}},U=new B.yh({strict:!1,state:{enforced:!1,enforcedGroups:[],excludedGroups:[]},mutations:M});o.nc=btoa(OC.requestToken),r.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},U.replaceState((0,s.loadState)("settings","mandatory2FAState")),new(r.default.extend($))({store:U}).$mount("#two-factor-auth-settings")},8496:function(t,e,n){var o=n(87537),s=n.n(o),r=n(23645),i=n.n(r)()(s());i.push([t.id,"\n.two-factor-loading[data-v-63855edf] {\n\tdisplay: inline-block;\n\tvertical-align: sub;\n\tmargin-left: -2px;\n\tmargin-right: 1px;\n}\n.top-margin[data-v-63855edf] {\n\tmargin-top: 0.5rem;\n}\n","",{version:3,sources:["webpack://./apps/settings/src/components/AdminTwoFactor.vue"],names:[],mappings:";AAsKA;CACA,qBAAA;CACA,mBAAA;CACA,iBAAA;CACA,iBAAA;AACA;AAEA;CACA,kBAAA;AACA",sourcesContent:["\n\n