mirror of
https://github.com/friendica/friendica
synced 2024-11-10 06:22:53 +00:00
Merge pull request #11106 from annando/issue-11101
Issue 11101: Fix API authentification
This commit is contained in:
commit
9f401a5952
2 changed files with 19 additions and 12 deletions
|
@ -26,12 +26,17 @@ use Friendica\Database\DBA;
|
|||
use Friendica\DI;
|
||||
use Friendica\Module\BaseApi;
|
||||
use Friendica\Util\Network;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Apps class to register new OAuth clients
|
||||
*/
|
||||
class Apps extends BaseApi
|
||||
{
|
||||
public function run(array $request = [], bool $scopecheck = true): ResponseInterface
|
||||
{
|
||||
return parent::run($request, false);
|
||||
}
|
||||
/**
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
|
|
|
@ -79,8 +79,9 @@ class BaseApi extends BaseModule
|
|||
*
|
||||
* @throws HTTPException\ForbiddenException
|
||||
*/
|
||||
public function run(array $request = []): ResponseInterface
|
||||
public function run(array $request = [], bool $scopecheck = true): ResponseInterface
|
||||
{
|
||||
if ($scopecheck) {
|
||||
switch ($this->server['REQUEST_METHOD'] ?? Router::GET) {
|
||||
case Router::DELETE:
|
||||
case Router::PATCH:
|
||||
|
@ -93,6 +94,7 @@ class BaseApi extends BaseModule
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::run($request);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue