fix(files_sharing): limit the share token input to the maximum token length#61826
fix(files_sharing): limit the share token input to the maximum token length#61826MiMoHo wants to merge 2 commits into
Conversation
…length The custom share link token input accepted arbitrarily long values, while the server (and the oc_share.token database column) only allows 32 characters. Users learned about the limit only after submitting the form and reading the error toast. Set the maxlength attribute on the token input matching ShareAPIController::TOKEN_MAX_LENGTH and mention the length and character constraints in the helper text, so the limit is communicated before saving instead of after a failed request. Related: nextcloud#61416, follow-up to nextcloud#61630 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
a1a9f35 to
d4c832c
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
The custom share link token input accepts arbitrarily long values, while the server (and the
oc_share.tokendatabase column) only allows 32 characters. Before #61630 this failed at the database layer with a generic "Failed to update share."; since #61630 the server returns a descriptive validation message — but in both cases users only learn about the limit after submitting the form.This communicates the constraint up front:
maxlengthon the token input, matchingShareAPIController::TOKEN_MAX_LENGTH(32), so the input simply cannot exceed the limit, andTesting
Verified against a local instance (Playwright):
maxlength="32",Related: #61416 — follow-up to #61630 (server-side validation).
🤖 Generated with Claude Code