mirror of
https://github.com/friendica/friendica
synced 2025-04-25 20:30:11 +00:00
Added scope check
This commit is contained in:
parent
33573dda34
commit
49207a8624
53 changed files with 107 additions and 62 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue