mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
feat(sharing): Respect admin custom tokens setting
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
4d78de497f
commit
0eb39d7b9c
1 changed files with 3 additions and 0 deletions
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue