mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Move jsonError out of Factory\Api\Mastodon\Error->Unauthorized
This commit is contained in:
parent
7486ebdc10
commit
6a2ca1a6b6
4 changed files with 10 additions and 13 deletions
|
@ -64,13 +64,10 @@ class Error extends BaseFactory
|
|||
return new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||
}
|
||||
|
||||
public function Unauthorized(string $error = '', string $error_description = '')
|
||||
public function Unauthorized(string $error = '', string $error_description = ''): \Friendica\Object\Api\Mastodon\Error
|
||||
{
|
||||
$error = $error ?: $this->l10n->t('Unauthorized');
|
||||
$errorObj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||
|
||||
$this->logError(401, $error);
|
||||
$this->jsonError(401, $errorObj->toArray());
|
||||
return new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||
}
|
||||
|
||||
public function Forbidden(string $error = '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue