server/dist/settings-vue-settings-admin...

3 lines
13 KiB
JavaScript
Raw Normal View History

/*! For license information please see settings-vue-settings-admin-security.js.LICENSE.txt */
(()=>{"use strict";var e,n={24470:(e,n,o)=>{var s=o(16453),r=o(20144),a=o(4820),i=o(7811),c=o.n(i),l=o(96486),d=o.n(l),u=o(79753);const p={name:"AdminTwoFactor",components:{Multiselect:c()},data:()=>({loading:!1,dirty:!1,groups:[],loadingGroups:!1}),computed:{enforced:{get(){return this.$store.state.enforced},set(t){this.dirty=!0,this.$store.commit("setEnforced",t)}},enforcedGroups:{get(){return this.$store.state.enforcedGroups},set(t){this.dirty=!0,this.$store.commit("setEnforcedGroups",t)}},excludedGroups:{get(){return this.$store.state.excludedGroups},set(t){this.dirty=!0,this.$store.commit("setExcludedGroups",t)}}},mounted(){this.groups=d().sortedUniq(d().uniq(this.enforcedGroups.concat(this.excludedGroups))),this.searchGroup("")},methods:{searchGroup:d().debounce((function(t){this.loadingGroups=!0,a.default.get((0,u.generateOcsUrl)("cloud/groups?offset=0&search={query}&limit=20",{query:t})).then((t=>t.data.ocs)).then((t=>t.data.groups)).then((t=>{this.groups=d().sortedUniq(d().uniq(this.groups.concat(t)))})).catch((t=>console.error("could not search groups",t))).then((()=>{this.loadingGroups=!1}))}),500),saveChanges(){this.loading=!0;const t={enforced:this.enforced,enforcedGroups:this.enforcedGroups,excludedGroups:this.excludedGroups};a.default.put((0,u.generateUrl)("/settings/api/admin/twofactorauth"),t).then((t=>t.data)).then((t=>{this.state=t,this.dirty=!1})).catch((t=>{console.error("could not save changes",t)})).then((()=>{this.loading=!1}))}}};var f=o(93379),h=o.n(f),g=o(37331);h()(g.Z,{insert:"head",singleton:!1}),g.Z.locals;const m=(0,o(51900).Z)(p,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("p",{staticClass:"settings-hint"},[t._v("\n\t\t"+t._s(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."))+"\n\t")]),t._v(" "),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("p",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.enforced,expression:"enforced"}],staticClass:"checkbox",attrs:{id:"two-factor-enforced",type:"checkbox"},domProps:{checked:Array.isArray(t.enforced)?t._i(t.enforced,null)>-1:t.enforced},on:{change:function(e){var n=t.enforced,o=e.target,s=!!o.checked;if(Array.isArray(n)){var r=t._i(n,null);o.checked?r<0&&(t.enforced=n.concat([null])):r>-1&&(t.enforced=n.slice(0,r).concat(n.slice(r+1)))}else t.enforced=s}}}),t._v(" "),n("label",{attrs:{for:"two-factor-enforced"}},[t._v(t._s(t.t("settings","Enforce two-factor authentication")))])]),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",[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",[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",[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
//# sourceMappingURL=settings-vue-settings-admin-security.js.map?v=0aad746b174102cf7300