diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index c1cc67ca72289..0294d0b860dce 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -122,7 +122,8 @@ v-model="share.token" autocomplete="off" :label="t('files_sharing', 'Share link token')" - :helper-text="t('files_sharing', 'Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information.')" + :helper-text="t('files_sharing', 'Set the public share link token to something easy to remember or generate a new token. Tokens can be up to {maxLength} characters long and may only contain letters, numbers, and hyphens. It is not recommended to use a guessable token for shares which contain sensitive information.', { maxLength: TOKEN_MAX_LENGTH })" + :maxlength="TOKEN_MAX_LENGTH" show-trailing-button :trailing-button-label="loadingToken ? t('files_sharing', 'Generating…') : t('files_sharing', 'Generate new token')" @trailing-button-click="generateNewToken"> @@ -340,6 +341,12 @@ import logger from '../services/logger.ts' import { generateToken } from '../services/TokenService.ts' import GeneratePassword from '../utils/GeneratePassword.ts' +/** + * Maximum length of a custom share token, matching the oc_share.token + * database column (see ShareAPIController::TOKEN_MAX_LENGTH). + */ +const TOKEN_MAX_LENGTH = 32 + /** @typedef {import('../models/Share.js').default} Share */ export default { name: 'SharingDetailsTab', @@ -389,6 +396,7 @@ export default { data() { return { + TOKEN_MAX_LENGTH, writeNoteToRecipientIsChecked: false, sharingPermission: getBundledPermissions().ALL.toString(), revertSharingPermission: getBundledPermissions().ALL.toString(),