1 |
- {"version":3,"file":"settings-vue-settings-personal-password.mjs","sources":["../apps/settings/src/components/PasswordSection.vue","../apps/settings/src/main-personal-password.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<NcSettingsSection :name=\"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\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\tspellcheck=\"false\" />\n\n\t\t\t<NcPasswordField id=\"new-pass\"\n\t\t\t\t:label=\"t('settings', 'New password')\"\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\tspellcheck=\"false\"\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","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\n\nimport PasswordSection from './components/PasswordSection.vue'\nimport { translate as t, translatePlural as n } from '@nextcloud/l10n'\n\nVue.prototype.t = t\nVue.prototype.n = n\n\nexport default new Vue({\n\tel: '#security-password',\n\tname: 'main-personal-password',\n\trender: h => h(PasswordSection),\n})\n"],"names":["_sfc_main","NcSettingsSection","NcButton","NcPasswordField","axios","generateUrl","res","data","showError","showSuccess","Vue","t","n","mainPersonalPassword","h","PasswordSection"],"mappings":";oQAyCA,MAAAA,EAAA,CACA,KAAA,kBACA,WAAA,CACA,kBAAAC,EACA,SAAAC,EACA,gBAAAC,CACA,EACA,MAAA,CACA,MAAA,CACA,QAAA,GACA,QAAA,EACA,CACA,EACA,QAAA,CACA,gBAAA,CACAC,EAAA,KAAAC,EAAA,mCAAA,EAAA,CACA,YAAA,KAAA,QACA,YAAA,KAAA,OACA,CAAA,EACA,KAAAC,GAAAA,EAAA,IAAA,EACA,KAAAC,GAAA,CACAA,EAAA,SAAA,SACA,KAAA,aAAAA,EAAA,KAAA,QACAC,EAAAD,EAAA,KAAA,OAAA,GAEAE,EAAAF,EAAA,KAAA,OAAA,CAEA,CAAA,CACA,CACA,CACA,+8BC7DAG,EAAI,UAAU,EAAIC,EAClBD,EAAI,UAAU,EAAIE,EAElB,MAAeC,EAAA,IAAIH,EAAI,CACtB,GAAI,qBACJ,KAAM,yBACN,OAAQI,GAAKA,EAAEC,CAAe,CAC/B,CAAC"}
|