@ -517,7 +517,7 @@ export default {
return true
return true
}
}
/ / C h e c k i f e i t h e r p a s s w o r d o r e x p i r a t i o n d a t e i s m i s s i n g a n d e n f o r c e d
/ / C h e c k i f e i t h e r p a s s w o r d o r e x p i r a t i o n d a t e i s m i s s i n g a n d e n f o r c e d
const isPasswordMissing = this . config . enforcePasswordForPublicLink && ! this . share . p assword
const isPasswordMissing = this . config . enforcePasswordForPublicLink && ! this . share . newP assword
const isExpireDateMissing = this . config . isDefaultExpireDateEnforced && ! this . share . expireDate
const isExpireDateMissing = this . config . isDefaultExpireDateEnforced && ! this . share . expireDate
return isPasswordMissing || isExpireDateMissing
return isPasswordMissing || isExpireDateMissing
@ -639,15 +639,12 @@ export default {
logger . info ( 'Share policy requires a review or has mandated properties (password, expirationDate)...' )
logger . info ( 'Share policy requires a review or has mandated properties (password, expirationDate)...' )
/ / E L S E , s h o w t h e p e n d i n g p o p o v e r m e n u
const share = new Share ( shareDefaults )
/ / i f p a s s w o r d d e f a u l t o r e n f o r c e d , p r e - f i l l w i t h r a n d o m o n e
/ / i f p a s s w o r d d e f a u l t o r e n f o r c e d , p r e - f i l l w i t h r a n d o m o n e
if ( this . config . enableLinkPasswordByDefault || this . config . enforcePasswordForPublicLink ) {
if ( this . config . enableLinkPasswordByDefault || this . config . enforcePasswordForPublicLink ) {
shareDefaults . password = await GeneratePassword ( true )
this . $set ( share , 'newPassword' , await GeneratePassword ( true ) )
}
}
/ / c r e a t e s h a r e & c l o s e m e n u
const share = new Share ( shareDefaults )
share . newPassword = share . password
const component = await new Promise ( resolve => {
const component = await new Promise ( resolve => {
this . $emit ( 'add:share' , share , resolve )
this . $emit ( 'add:share' , share , resolve )
} )
} )
@ -711,7 +708,7 @@ export default {
const options = {
const options = {
path ,
path ,
shareType : ShareType . Link ,
shareType : ShareType . Link ,
password : share . p assword,
password : share . newP assword,
expireDate : share . expireDate ? ? '' ,
expireDate : share . expireDate ? ? '' ,
attributes : JSON . stringify ( this . fileInfo . shareAttributes ) ,
attributes : JSON . stringify ( this . fileInfo . shareAttributes ) ,
/ / w e d o n o t a l l o w s e t t i n g t h e p u b l i c U p l o a d
/ / w e d o n o t a l l o w s e t t i n g t h e p u b l i c U p l o a d
@ -815,10 +812,8 @@ export default {
* cannot ensure data is up - to - date
* cannot ensure data is up - to - date
* /
* /
onPasswordDisable ( ) {
onPasswordDisable ( ) {
this . share . password = ''
/ / r e s e t p a s s w o r d s t a t e a f t e r s y n c
/ / r e s e t p a s s w o r d s t a t e a f t e r s y n c
this . $delete ( this . share , 'newPassword' )
this . $set ( this . share , 'newPassword' , '' )
/ / o n l y u p d a t e i f v a l i d s h a r e .
/ / o n l y u p d a t e i f v a l i d s h a r e .
if ( this . share . id ) {
if ( this . share . id ) {