mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #48991 from nextcloud/fix/password-field-sharing
fix(files_sharing): Password field must not be required if already set
This commit is contained in:
commit
878ccc406b
9 changed files with 22 additions and 10 deletions
|
|
@ -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)
|
||||
},
|
||||
|
|
|
|||
1
dist/2093-2093.js.map
vendored
1
dist/2093-2093.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/2093-2093.js.map.license
vendored
1
dist/2093-2093.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
2093-2093.js.license
|
||||
4
dist/2093-2093.js → dist/5419-5419.js
vendored
4
dist/2093-2093.js → dist/5419-5419.js
vendored
File diff suppressed because one or more lines are too long
1
dist/5419-5419.js.map
vendored
Normal file
1
dist/5419-5419.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/5419-5419.js.map.license
vendored
Symbolic link
1
dist/5419-5419.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
5419-5419.js.license
|
||||
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue