Skip to content

fix(sharing): Use link_defaultExpDays for default expiration in web UI#58343

Open
nfebe wants to merge 3 commits intomasterfrom
fix/link-default-exp-days
Open

fix(sharing): Use link_defaultExpDays for default expiration in web UI#58343
nfebe wants to merge 3 commits intomasterfrom
fix/link-default-exp-days

Conversation

@nfebe
Copy link
Copy Markdown
Contributor

@nfebe nfebe commented Feb 13, 2026

The link_defaultExpDays config was only used in the backend share validation but never exposed to the frontend, making it impossible to set a default expiration date different from the maximum.

@nfebe nfebe requested review from a team as code owners February 13, 2026 18:35
@nfebe nfebe requested review from ArtificialOwl, artonge, icewind1991, sorbaugh and susnux and removed request for a team February 13, 2026 18:35
@julien-nc
Copy link
Copy Markdown
Member

Thank you for this PR!

This partially works. The default date is now correct: now + link_defaultExpDays if link_defaultExpDays is set.

But the maximum date is the same as the default in the UI. So even if shareapi_expire_after_n_days is higher than link_defaultExpDays, one cannot set a higher date than the default one.

I think this can be addressed in apps/files_sharing/src/mixins/SharesMixin.js where maxExpirationDateEnforced is defined.

maxExpirationDateEnforced() {

@julien-nc
Copy link
Copy Markdown
Member

IMO this can be backported to 31, 32 and 33.

@nfebe nfebe force-pushed the fix/link-default-exp-days branch 2 times, most recently from f5a36d5 to 531beef Compare February 24, 2026 20:27
@nfebe nfebe requested a review from provokateurin as a code owner February 24, 2026 20:27
@nfebe nfebe force-pushed the fix/link-default-exp-days branch from 531beef to 8bffd6a Compare February 25, 2026 00:18
@nfebe
Copy link
Copy Markdown
Contributor Author

nfebe commented Feb 25, 2026

/compile /

The link_defaultExpDays config was only used in the backend share
validation but never exposed to the frontend, making it impossible
to set a default expiration date different from the maximum.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
The maxExpirationDateEnforced was using defaultExpirationDate which
now returns the default date (linkDefaultExpDays) instead of the
maximum (shareapi_expire_after_n_days), preventing users from picking
dates between the default and maximum.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the fix/link-default-exp-days branch from dfdf282 to f1ff7d7 Compare February 25, 2026 00:36
@nfebe
Copy link
Copy Markdown
Contributor Author

nfebe commented Feb 25, 2026

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Copy link
Copy Markdown
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default date and the max date are now independent and effective in the UI 👍

@nfebe
Copy link
Copy Markdown
Contributor Author

nfebe commented Feb 25, 2026

/backport to stable33

@nfebe
Copy link
Copy Markdown
Contributor Author

nfebe commented Feb 25, 2026

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants