aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-10-30 13:40:19 +0100
committerGitHub <noreply@github.com>2024-10-30 13:40:19 +0100
commit878ccc406b411b137d1663456be2ed34269b2e51 (patch)
treee8c7b5d982efeb0bfc7926775d226f7ef931979d /apps
parent399b048b152915f8d0e3deade3009c970b8c41b9 (diff)
parente13b6d3ee17e69c9df5621588d5f658d1a87468f (diff)
downloadnextcloud-server-878ccc406b411b137d1663456be2ed34269b2e51.tar.gz
nextcloud-server-878ccc406b411b137d1663456be2ed34269b2e51.zip
Merge pull request #48991 from nextcloud/fix/password-field-sharing
fix(files_sharing): Password field must not be required if already set
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 3f9dca57d03..0878c5d289d 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -116,8 +116,8 @@
autocomplete="new-password"
:value="hasUnsavedPassword ? share.newPassword : ''"
:error="passwordError"
- :helper-text="errorPasswordLabel"
- :required="isPasswordEnforced"
+ :helper-text="errorPasswordLabel || passwordHint"
+ :required="isPasswordEnforced && isNewShare"
:label="t('files_sharing', 'Password')"
@update:value="onPasswordChange" />
@@ -723,6 +723,13 @@ export default {
return undefined
},
+ passwordHint() {
+ if (this.isNewShare || this.hasUnsavedPassword) {
+ return undefined
+ }
+ return t('files_sharing', 'Replace current password')
+ },
+
/**
* Additional actions for the menu
*
@@ -887,7 +894,7 @@ export default {
if (this.hasUnsavedPassword && this.isValidShareAttribute(this.share.newPassword)) {
this.share.password = this.share.newPassword
this.$delete(this.share, 'newPassword')
- } else if (this.isPasswordEnforced && !this.isValidShareAttribute(this.share.password)) {
+ } else if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) {
this.passwordError = true
}
} else {
@@ -981,6 +988,11 @@ export default {
* @param {string} password the changed password
*/
onPasswordChange(password) {
+ if (password === '') {
+ this.$delete(this.share, 'newPassword')
+ this.passwordError = this.isNewShare && this.isPasswordEnforced
+ return
+ }
this.passwordError = !this.isValidShareAttribute(password)
this.$set(this.share, 'newPassword', password)
},