File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7979 :value .sync =" share .newPassword "
8080 :disabled =" saving "
8181 :required =" config .enableLinkPasswordByDefault || config .enforcePasswordForPublicLink "
82- :minlength =" isPasswordPolicyEnabled && config . passwordPolicy . minLength "
82+ :minlength =" minPasswordLength "
8383 autocomplete="new-password"
8484 @submit =" onNewLinkShare (true )" >
8585 <template #icon >
@@ -342,6 +342,16 @@ export default {
342342 },
343343
344344 computed: {
345+ minPasswordLength () {
346+ if (this .isPasswordPolicyEnabled ) {
347+ if (this .config .passwordPolicy .policies ? .sharing ? .minLength ) {
348+ return this .config .passwordPolicy .policies .sharing .minLength
349+ }
350+ return this .config .passwordPolicy .minLength
351+ }
352+ return 0
353+ },
354+
345355 /**
346356 * Link share label
347357 *
Original file line number Diff line number Diff line change 55import { getCapabilities } from '@nextcloud/capabilities'
66import { loadState } from '@nextcloud/initial-state'
77
8- type PasswordPolicyCapabilities = {
8+ type PasswordPolicySettings = {
99 enforceNonCommonPassword : boolean
1010 enforceNumericCharacters : boolean
1111 enforceSpecialCharacters : boolean
1212 enforceUpperLowerCase : boolean
1313 minLength : number
1414}
1515
16+ type PasswordPolicyCapabilities = PasswordPolicySettings & {
17+ api ?: {
18+ generate : string
19+ validate : string
20+ }
21+ policies ?: {
22+ sharing : PasswordPolicySettings
23+ }
24+ }
25+
1626type FileSharingCapabilities = {
1727 api_enabled : boolean ,
1828 public : {
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ export default async function(verbose = false): Promise<string> {
2121 // password policy is enabled, let's request a pass
2222 if ( config . passwordPolicy . api && config . passwordPolicy . api . generate ) {
2323 try {
24- const request = await axios . get ( config . passwordPolicy . api . generate )
24+ const request = await axios . get ( config . passwordPolicy . api . generate , {
25+ params : { context : 'sharing' } ,
26+ } )
2527 if ( request . data . ocs . data . password ) {
2628 if ( verbose ) {
2729 showSuccess ( t ( 'files_sharing' , 'Password created successfully' ) )
You can’t perform that action at this time.
0 commit comments