mirror of
https://github.com/nextcloud/server.git
synced 2026-11-23 14:04:24 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
{"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 encryption key could not be unlocked. If your login password has changed, try entering your previous login password to unlock your key, then your current password to update your key and restore access.')\">\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\n\t\t\t\tv-model=\"oldPrivateKeyPassword\"\n\t\t\t\trequired\n\t\t\t\tname=\"oldPassword\"\n\t\t\t\t:label=\"t('encryption', 'Previous login password')\" />\n\t\t\t<NcPasswordField\n\t\t\t\tv-model=\"newPrivateKeyPassword\"\n\t\t\t\trequired\n\t\t\t\tname=\"newPassword\"\n\t\t\t\t:label=\"t('encryption', 'Current login 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 (isAxiosError(error) && error.response && error.response.data?.data?.message) {\n\t\t\tshowError(error.response.data.data.message)\n\t\t}\n\t} finally {\n\t\ttoast.hideToast()\n\t\tisLoading.value = false\n\t}\n}, { debounce: 800 })\n</script>\n\n<template>\n\t<NcCheckboxRadioSwitch\n\t\tv-model=\"userEnableRecovery\"\n\t\ttype=\"switch\"\n\t\t:loading=\"isLoading\"\n\t\t:description=\"t('encryption', 'Controls whether the administrator can use the recovery key to restore access to your encrypted files if you lose your login password.')\">\n\t\t{{ t('encryption', 'Allow recovery of my encrypted files') }}\n\t</NcCheckboxRadioSwitch>\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 from '@nextcloud/axios'\nimport { showInfo } from '@nextcloud/dialogs'\nimport { loadState } from '@nextcloud/initial-state'\nimport { t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { ref } from 'vue'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'\nimport SettingsPersonalChangePrivateKey from '../components/SettingsPersonalChangePrivateKey.vue'\nimport SettingsPersonalEnableRecovery from '../components/SettingsPersonalEnableRecovery.vue'\nimport { logger } from '../utils/logger.ts'\nimport { InitStatus } from '../utils/types.ts'\n\nconst personalSettings = loadState<{\n\trecoveryEnabled: boolean\n\trecoveryEnabledForUser: boolean\n\tprivateKeySet: boolean\n\tinitialized: typeof InitStatus[keyof typeof InitStatus]\n}>('encryption', 'personalSettings')\n\nconst initialized = ref(personalSettings.initialized)\nconst recoveryEnabledForUser = ref(personalSettings.recoveryEnabledForUser)\n\n/**\n * Reload encryption status\n */\nasync function reloadStatus() {\n\ttry {\n\t\tconst { data } = await axios.get(generateUrl('/apps/encryption/ajax/getStatus'))\n\t\tinitialized.value = data.initStatus\n\t\tif (data.data.message) {\n\t\t\tshowInfo(data.data.message)\n\t\t}\n\t} catch (error) {\n\t\tlogger.error('Failed to fetch current encryption status', { error })\n\t}\n}\n</script>\n\n<template>\n\t<NcSettingsSection :name=\"t('encryption', 'Default encryption module')\">\n\t\t<NcNoteCard v-if=\"initialized === InitStatus.NotInitialized\" type=\"warning\">\n\t\t\t{{ t('encryption', 'Your encryption keys are not initialized for this session. Please sign out and sign back in.') }}\n\t\t</NcNoteCard>\n\n\t\t<SettingsPersonalChangePrivateKey\n\t\t\tv-else-if=\"initialized === InitStatus.InitExecuted\"\n\t\t\t:recoveryEnabledForUser\n\t\t\t@updated=\"reloadStatus\" />\n\t\t<SettingsPersonalEnableRecovery\n\t\t\tv-else-if=\"personalSettings.recoveryEnabled && personalSettings.privateKeySet\"\n\t\t\tv-model=\"recoveryEnabledForUser\" />\n\t</NcSettingsSection>\n</template>\n","/*!\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createApp } from 'vue'\nimport SettingsPersonal from './views/SettingsPersonal.vue'\n\nconst app = createApp(SettingsPersonal)\napp.mount('#encryption-settings-section')\n"],"names":["emit","__emit","formElement","useTemplateRef","isLoading","ref","hasError","oldPrivateKeyPassword","newPrivateKeyPassword","onSubmit","axios","generateUrl","error","isAxiosError","showError","_createElementBlock","_createVNode","_unref","NcFormGroup","t","__props","_createBlock","NcNoteCard","NcPasswordField","$event","NcButton","userEnableRecovery","_useModel","watch","watchDebounced","newValue","oldValue","toast","showLoading","NcCheckboxRadioSwitch","personalSettings","loadState","initialized","recoveryEnabledForUser","reloadStatus","data","showInfo","logger","NcSettingsSection","InitStatus","SettingsPersonalChangePrivateKey","SettingsPersonalEnableRecovery","app","createApp","SettingsPersonal"],"mappings":"6nGAiBA,MAAMA,EAAOC,EAIPC,EAAcC,EAAe,MAAM,EAEnCC,EAAYC,EAAI,EAAK,EACrBC,EAAWD,EAAI,EAAK,EACpBE,EAAwBF,EAAI,EAAE,EAC9BG,EAAwBH,EAAI,EAAE,EAKpC,eAAeI,GAAW,CACzB,GAAI,CAAAL,EAAU,MAId,CAAAA,EAAU,MAAQ,GAClBE,EAAS,MAAQ,GACjB,GAAI,CACH,MAAMI,EAAM,KACXC,EAAY,gDAAgD,EAC5D,CACC,YAAaJ,EAAsB,MACnC,YAAaC,EAAsB,KAAA,CACpC,EAEDD,EAAsB,MAAQC,EAAsB,MAAQ,GAC5DN,EAAY,OAAO,MAAA,EACnBF,EAAK,SAAS,CACf,OAASY,EAAO,CACXC,EAAaD,CAAK,GAAKA,EAAM,UAAYA,EAAM,SAAS,MAAM,MAAM,SACvEE,EAAUF,EAAM,SAAS,KAAK,KAAK,OAAO,EAE3CN,EAAS,MAAQ,EAClB,QAAA,CACCF,EAAU,MAAQ,EACnB,CAAA,CACD,mBAICW,EAyBO,OAAA,CAzBD,IAAI,OAAQ,WAAgBN,EAAQ,CAAA,SAAA,CAAA,CAAA,GACzCO,EAuBcC,EAAAC,CAAA,EAAA,CAtBZ,MAAOD,EAAAE,CAAA,EAAC,aAAA,6BAAA,EACR,YAAaF,EAAAE,CAAA,EAAC,aAAA,wNAAA,CAAA,aACf,IAEa,CAFKC,EAAA,4BAAlBC,EAEaJ,EAAAK,CAAA,EAAA,CAAA,IAAA,GAAA,WADZ,IAAuH,KAApHL,EAAAE,CAAA,EAAC,aAAA,gGAAA,CAAA,EAAA,CAAA,CAAA,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