Skip to content

Commit 4754104

Browse files
committed
fix(sharing): Prevent generated password from overwriting user input
fix(sharing): Prevent generated password from overwriting user input Signed-off-by: nfebe <fenn25.fn@gmail.com> [skip ci]
1 parent 5ca3976 commit 4754104

File tree

5 files changed

+166
-192
lines changed

5 files changed

+166
-192
lines changed

apps/files_sharing/src/mixins/SharesMixin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ export default {
180180
async set(enabled) {
181181
if (enabled) {
182182
this.passwordProtectedState = true
183-
this.$set(this.share, 'newPassword', await GeneratePassword(true))
183+
const generatedPassword = await GeneratePassword(true)
184+
if (!this.share.newPassword) {
185+
this.$set(this.share, 'newPassword', generatedPassword)
186+
}
184187
} else {
185188
this.passwordProtectedState = false
186189
this.$set(this.share, 'newPassword', '')

0 commit comments

Comments
 (0)