settings-vue-settings-personal-password.js 7.2 KB

123
  1. /*! For license information please see settings-vue-settings-personal-password.js.LICENSE.txt */
  2. (()=>{"use strict";var t,e={5738:(t,e,n)=>{var s=n(20144),o=n(13299),a=n.n(o),r=n(10861),i=n.n(r),l=n(22660),d=n.n(l),c=n(26937),u=n(79753),p=n(3255);const w={name:"PasswordSection",components:{NcSettingsSection:a(),NcButton:i(),NcPasswordField:d()},data:()=>({oldPass:"",newPass:""}),methods:{changePassword(){c.Z.post((0,u.generateUrl)("/settings/personal/changepassword"),{oldpassword:this.oldPass,newpassword:this.newPass}).then((t=>t.data)).then((t=>{"error"===t.status?(this.errorMessage=t.data.message,(0,p.x2)(t.data.message)):(0,p.s$)(t.data.message)}))}}};var h=n(93379),m=n.n(h),f=n(7795),g=n.n(f),v=n(90569),b=n.n(v),P=n(3565),y=n.n(P),A=n(19216),S=n.n(A),N=n(44589),x=n.n(N),C=n(73954),O={};O.styleTagTransform=x(),O.setAttributes=y(),O.insert=b().bind(null,"head"),O.domAPI=g(),O.insertStyleElement=S(),m()(C.Z,O),C.Z&&C.Z.locals&&C.Z.locals;const T=(0,n(51900).Z)(w,(function(){var t=this,e=t._self._c;return e("NcSettingsSection",{attrs:{title:t.t("settings","Password")}},[e("form",{attrs:{id:"passwordform",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.changePassword.apply(null,arguments)}}},[e("NcPasswordField",{attrs:{id:"old-pass",label:t.t("settings","Current password"),"label-visible":!0,name:"oldpassword",value:t.oldPass,autocomplete:"current-password",autocapitalize:"none",autocorrect:"off"},on:{"update:value":function(e){t.oldPass=e}}}),t._v(" "),e("NcPasswordField",{attrs:{id:"new-pass",label:t.t("settings","New password"),"label-visible":!0,value:t.newPass,maxlength:469,autocomplete:"new-password",autocapitalize:"none",autocorrect:"off","check-password-strength":!0},on:{"update:value":function(e){t.newPass=e}}}),t._v(" "),e("NcButton",{attrs:{type:"primary","native-type":"submit",disabled:0===t.newPass.length||0===t.oldPass.length}},[t._v("\n\t\t\t"+t._s(t.t("settings","Change password"))+"\n\t\t")])],1)])}),[],!1,null,null,null).exports;var F=n(31352);n.nc=btoa(OC.requestToken),s.default.prototype.t=F.Iu,s.default.prototype.n=F.uN,new s.default({el:"#security-password",name:"main-personal-password",render:t=>t(T)})},73954:(t,e,n)=>{n.d(e,{Z:()=>i});var s=n(87537),o=n.n(s),a=n(23645),r=n.n(a)()(o());r.push([t.id,"\n#passwordform {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 1rem;\n\tmax-width: 400px;\n}\n","",{version:3,sources:["webpack://./apps/settings/src/components/PasswordSection.vue"],names:[],mappings:";AAmGA;CACA,aAAA;CACA,sBAAA;CACA,SAAA;CACA,gBAAA;AACA",sourcesContent:['\x3c!--\n - @copyright 2022 Carl Schwan <carl@carlschwan.eu>\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 <http://www.gnu.org/licenses/>.\n --\x3e\n<template>\n\t<NcSettingsSection :title="t(\'settings\', \'Password\')">\n\t\t<form id="passwordform" method="POST" @submit.prevent="changePassword">\n\t\t\t<NcPasswordField id="old-pass"\n\t\t\t\t:label="t(\'settings\', \'Current password\')"\n\t\t\t\t:label-visible="true"\n\t\t\t\tname="oldpassword"\n\t\t\t\t:value.sync="oldPass"\n\t\t\t\tautocomplete="current-password"\n\t\t\t\tautocapitalize="none"\n\t\t\t\tautocorrect="off" />\n\n\t\t\t<NcPasswordField id="new-pass"\n\t\t\t\t:label="t(\'settings\', \'New password\')"\n\t\t\t\t:label-visible="true"\n\t\t\t\t:value.sync="newPass"\n\t\t\t\t:maxlength="469"\n\t\t\t\tautocomplete="new-password"\n\t\t\t\tautocapitalize="none"\n\t\t\t\tautocorrect="off"\n\t\t\t\t:check-password-strength="true" />\n\n\t\t\t<NcButton type="primary"\n\t\t\t\tnative-type="submit"\n\t\t\t\t:disabled="newPass.length === 0 || oldPass.length === 0">\n\t\t\t\t{{ t(\'settings\', \'Change password\') }}\n\t\t\t</NcButton>\n\t\t</form>\n\t</NcSettingsSection>\n</template>\n\n<script>\nimport NcSettingsSection from \'@nextcloud/vue/dist/Components/NcSettingsSection.js\'\nimport NcButton from \'@nextcloud/vue/dist/Components/NcButton.js\'\nimport NcPasswordField from \'@nextcloud/vue/dist/Components/NcPasswordField.js\'\nimport axios from \'@nextcloud/axios\'\nimport { generateUrl } from \'@nextcloud/router\'\nimport { showSuccess, showError } from \'@nextcloud/dialogs\'\n\nexport default {\n\tname: \'PasswordSection\',\n\tcomponents: {\n\t\tNcSettingsSection,\n\t\tNcButton,\n\t\tNcPasswordField,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\toldPass: \'\',\n\t\t\tnewPass: \'\',\n\t\t}\n\t},\n\tmethods: {\n\t\tchangePassword() {\n\t\t\taxios.post(generateUrl(\'/settings/personal/changepassword\'), {\n\t\t\t\toldpassword: this.oldPass,\n\t\t\t\tnewpassword: this.newPass,\n\t\t\t})\n\t\t\t\t.then(res => res.data)\n\t\t\t\t.then(data => {\n\t\t\t\t\tif (data.status === \'error\') {\n\t\t\t\t\t\tthis.errorMessage = data.data.message\n\t\t\t\t\t\tshowError(data.data.message)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowSuccess(data.data.message)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n}\n<\/script>\n\n<style>\n\t#passwordform {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1rem;\n\t\tmax-width: 400px;\n\t}\n</style>\n'],sourceRoot:""}]);const i=r}},n={};function s(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,s),a.loaded=!0,a.exports}s.m=e,t=[],s.O=(e,n,o,a)=>{if(!n){var r=1/0;for(c=0;c<t.length;c++){n=t[c][0],o=t[c][1],a=t[c][2];for(var i=!0,l=0;l<n.length;l++)(!1&a||r>=a)&&Object.keys(s.O).every((t=>s.O[t](n[l])))?n.splice(l--,1):(i=!1,a<r&&(r=a));if(i){t.splice(c--,1);var d=o();void 0!==d&&(e=d)}}return e}a=a||0;for(var c=t.length;c>0&&t[c-1][2]>a;c--)t[c]=t[c-1];t[c]=[n,o,a]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=3574,(()=>{s.b=document.baseURI||self.location.href;var t={3574:0};s.O.j=e=>0===t[e];var e=(e,n)=>{var o,a,r=n[0],i=n[1],l=n[2],d=0;if(r.some((e=>0!==t[e]))){for(o in i)s.o(i,o)&&(s.m[o]=i[o]);if(l)var c=l(s)}for(e&&e(n);d<r.length;d++)a=r[d],s.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return s.O(c)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.nc=void 0;var o=s.O(void 0,[7874],(()=>s(5738)));o=s.O(o)})();
  3. //# sourceMappingURL=settings-vue-settings-personal-password.js.map?v=c84f27fdd3a2aea0a315