mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
Refine OAuth flow
This commit is contained in:
parent
78a85df86b
commit
7975bc244d
8 changed files with 134 additions and 32 deletions
|
@ -25,6 +25,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\BaseApi;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
/**
|
||||
* Apps class to register new OAuth clients
|
||||
|
@ -37,6 +38,17 @@ class Apps extends BaseApi
|
|||
*/
|
||||
public static function post(array $parameters = [])
|
||||
{
|
||||
// Workaround for AndStatus, see issue https://github.com/andstatus/andstatus/issues/538
|
||||
if (empty($_REQUEST['client_name']) || empty($_REQUEST['redirect_uris'])) {
|
||||
$postdata = Network::postdata();
|
||||
if (!empty($postdata)) {
|
||||
$_REQUEST = json_decode($postdata, true);
|
||||
if (empty($_REQUEST)) {
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Missing parameters'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$name = $_REQUEST['client_name'] ?? '';
|
||||
$redirect = $_REQUEST['redirect_uris'] ?? '';
|
||||
$scopes = $_REQUEST['scopes'] ?? '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue