Move jsonError out of Factory\Api\Mastodon\Error->UnprocessableEntity

This commit is contained in:
Hypolite Petovan 2023-10-11 09:20:49 -04:00
parent 7f846f153d
commit 7486ebdc10
52 changed files with 76 additions and 73 deletions

View file

@ -105,7 +105,7 @@ class Token extends BaseApi
$me = $owner['url'];
} else {
Logger::warning('Unsupported or missing grant type', ['request' => $_REQUEST]);
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Unsupported or missing grant type'));
$this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity($this->t('Unsupported or missing grant type')));
}
$object = new \Friendica\Object\Api\Mastodon\Token($token['access_token'], 'Bearer', $application['scopes'], $token['created_at'], $me);