File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8888 :label =" t (' files_sharing' , ' Enter a password' )"
8989 :disabled =" saving "
9090 :required =" config .enableLinkPasswordByDefault || config .enforcePasswordForPublicLink "
91- :minlength =" isPasswordPolicyEnabled && config . passwordPolicy . minLength "
91+ :minlength =" minPasswordLength "
9292 autocomplete="new-password"
9393 @submit =" onNewLinkShare (true )" >
9494 <template #icon >
@@ -349,6 +349,16 @@ export default {
349349 },
350350
351351 computed: {
352+ minPasswordLength () {
353+ if (this .isPasswordPolicyEnabled ) {
354+ if (this .config .passwordPolicy .policies ? .sharing ? .minLength ) {
355+ return this .config .passwordPolicy .policies .sharing .minLength
356+ }
357+ return this .config .passwordPolicy .minLength
358+ }
359+ return 0
360+ },
361+
352362 /**
353363 * Link share label
354364 *
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 @@ -22,7 +22,9 @@ export default async function(verbose = false): Promise<string> {
2222 // password policy is enabled, let's request a pass
2323 if ( config . passwordPolicy . api && config . passwordPolicy . api . generate ) {
2424 try {
25- const request = await axios . get ( config . passwordPolicy . api . generate )
25+ const request = await axios . get ( config . passwordPolicy . api . generate , {
26+ params : { context : 'sharing' } ,
27+ } )
2628 if ( request . data . ocs . data . password ) {
2729 if ( verbose ) {
2830 showSuccess ( t ( 'files_sharing' , 'Password created successfully' ) )
You can’t perform that action at this time.
0 commit comments