feat(sharing): Respect admin custom tokens setting

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2024-12-16 15:53:12 -08:00
parent 4d78de497f
commit 0eb39d7b9c

View file

@ -1331,6 +1331,9 @@ class ShareAPIController extends OCSController {
}
if ($token !== null) {
if (!$this->shareManager->allowCustomTokens()) {
throw new OCSForbiddenException($this->l->t('Custom share link tokens have been disabled by the administrator'));
}
if (!$this->validateToken($token)) {
throw new OCSBadRequestException($this->l->t('Tokens must contain at least 1 character and may only contain letters, numbers, or a hyphen'));
}