Added scope check

This commit is contained in:
Michael 2021-05-16 07:37:11 +00:00
parent 33573dda34
commit 49207a8624
53 changed files with 107 additions and 62 deletions

View file

@ -54,6 +54,15 @@ class Error extends BaseFactory
System::jsonError(401, $errorobj->toArray());
}
public function Forbidden(string $error = '')
{
$error = $error ?: DI::l10n()->t('Token is not authorized with a valid user or is missing a required scope');
$error_description = '';
$errorobj = New \Friendica\Object\Api\Mastodon\Error($error, $error_description);
System::jsonError(403, $errorobj->toArray());
}
public function InternalError(string $error = '')
{
$error = $error ?: DI::l10n()->t('Internal Server Error');