aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/mixins
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2022-04-14 21:08:53 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2022-06-08 11:29:19 +0000
commit50badb3fb6b6a7fa51520ce380ece09b0a181179 (patch)
tree019251a34dc4732f382f54d5122891a2ad95e54f /apps/files_sharing/src/mixins
parentb7bce42078369fc48df8234fb8e2f110f7b6484d (diff)
downloadnextcloud-server-50badb3fb6b6a7fa51520ce380ece09b0a181179.tar.gz
nextcloud-server-50badb3fb6b6a7fa51520ce380ece09b0a181179.zip
Various improvements related to the recent implementation of temporary passwords
for mail shares: 1- Changes style of "forgot password?" and "Back" button 2- Adds information about share password's expiration time in the emails sent. 3- Shows password expiration time in the Share menu 4- Fixes an issue when the message "Password expires..." would be shown for non email share types (which don't have temporary passswords) 5- At share's creation, password should only be sent when it's a permanent one See also https://github.com/nextcloud/server/issues/31952 Signed-off-by: Cyrille Bollu <cyrpub@bollu.be> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src/mixins')
-rw-r--r--apps/files_sharing/src/mixins/ShareRequests.js3
-rw-r--r--apps/files_sharing/src/mixins/SharesMixin.js5
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js
index bc6e3bf1644..e2668c15d65 100644
--- a/apps/files_sharing/src/mixins/ShareRequests.js
+++ b/apps/files_sharing/src/mixins/ShareRequests.js
@@ -103,8 +103,9 @@ export default {
const request = await axios.put(shareUrl + `/${id}`, properties)
if (!request?.data?.ocs) {
throw request
+ } else {
+ return request.data.ocs.data
}
- return true
} catch (error) {
console.error('Error while updating share', error)
if (error.response.status !== 400) {
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js
index 950b0355175..daeacfa4b8b 100644
--- a/apps/files_sharing/src/mixins/SharesMixin.js
+++ b/apps/files_sharing/src/mixins/SharesMixin.js
@@ -235,11 +235,14 @@ export default {
this.saving = true
this.errors = {}
try {
- await this.updateShare(this.share.id, properties)
+ const updatedShare = await this.updateShare(this.share.id, properties)
if (propertyNames.indexOf('password') >= 0) {
// reset password state after sync
this.$delete(this.share, 'newPassword')
+
+ // updates password expiration time after sync
+ this.share.passwordExpirationTime = updatedShare.password_expiration_time
}
// clear any previous errors