nextcloud/dist/encryption-settings_personal.mjs.map

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1 line
10 KiB
Text
Raw Normal View History

{"version":3,"file":"encryption-settings_personal.mjs","sources":["../build/frontend/apps/encryption/src/components/SettingsPersonalChangePrivateKey.vue","../build/frontend/apps/encryption/src/components/SettingsPersonalEnableRecovery.vue","../build/frontend/apps/encryption/src/views/SettingsPersonal.vue","../build/frontend/apps/encryption/src/settings-personal.ts"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n -->\n\n<script setup lang=\"ts\">\nimport axios, { isAxiosError } from '@nextcloud/axios'\nimport { showError } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcFormGroup, NcNoteCard, NcPasswordField } from '@nextcloud/vue'\nimport { ref, useTemplateRef } from 'vue'\n\ndefineProps<{\n\trecoveryEnabledForUser: boolean\n}>()\n\nconst emit = defineEmits<{\n\tupdated: []\n}>()\n\nconst formElement = useTemplateRef('form')\n\nconst isLoading = ref(false)\nconst hasError = ref(false)\nconst oldPrivateKeyPassword = ref('')\nconst newPrivateKeyPassword = ref('')\n\n/**\n * Handle the form submission to change the private key password\n */\nasync function onSubmit() {\n\tif (isLoading.value) {\n\t\treturn\n\t}\n\n\tisLoading.value = true\n\thasError.value = false\n\ttry {\n\t\tawait axios.post(\n\t\t\tgenerateUrl('/apps/encryption/ajax/updatePrivateKeyPassword'),\n\t\t\t{\n\t\t\t\toldPassword: oldPrivateKeyPassword.value,\n\t\t\t\tnewPassword: newPrivateKeyPassword.value,\n\t\t\t},\n\t\t)\n\t\toldPrivateKeyPassword.value = newPrivateKeyPassword.value = ''\n\t\tformElement.value?.reset()\n\t\temit('updated')\n\t} catch (error) {\n\t\tif (isAxiosError(error) && error.response && error.response.data?.data?.message) {\n\t\t\tshowError(error.response.data.data.message)\n\t\t}\n\t\thasError.value = true\n\t} finally {\n\t\tisLoading.value = false\n\t}\n}\n</script>\n\n<template>\n\t<form ref=\"form\" @submit.prevent=\"onSubmit\">\n\t\t<NcFormGroup\n\t\t\t:label=\"t('encryption', 'Update private key password')\"\n\t\t\t:description=\"t('encryption', 'Your private key password no longer matches your log-in password. Set your old private key password to your current log-in password.')\">\n\t\t\t<NcNoteCard v-if=\"recoveryEnabledForUser\">\n\t\t\t\t{{ t('encryption', 'If you do not remember your old password you can ask your administrator to recover your files.') }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<NcPasswordField :label=\"t('encryption', 'Old log-in password')\" />\n\t\t\t<NcPasswordField :label=\"t('encryption', 'Current log-in password')\" />\n\n\t\t\t<NcButton\n\t\t\t\ttype=\"submit\"\n\t\t\t\tvariant=\"primary\">\n\t\t\t\t{{ t('encryption', 'Update') }}\n\t\t\t</NcButton>\n\t\t</NcFormGroup>\n\t</form>\n</template>\n","<!--\n - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n -->\n\n<script setup lang=\"ts\">\nimport axios, { isAxiosError } from '@nextcloud/axios'\nimport { showError, showLoading } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { watchDebounced } from '@vueuse/core'\nimport { ref, watch } from 'vue'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'\n\nconst userEnableRecovery = defineModel<boolean>({ required: true })\nconst isLoading = ref(false)\n\nwatch(userEnableRecovery, () => {\n\tisLoading.value = true\n})\nwatchDebounced([userEnableRecovery], async ([newValue], [oldValue]) => {\n\tif (newValue === oldValue) {\n\t\t// user changed their mind (likely quickly toggled), do nothing\n\t\tisLoading.value = false\n\t\treturn\n\t}\n\n\tconst toast = showLoading(t('encryption', 'Updating recovery keys. This can take some time…'))\n\ttry {\n\t\tawait axios.post(\n\t\t\tgenerateUrl('/apps/encryption/ajax/userSetRecovery'),\n\t\t\t{ userEnableRecovery: userEnableRecovery.value },\n\t\t)\n\t} catch (error) {\n\t\tuserEnableRecovery.value = oldValue\n\t\tif