Skip to content

Commit

Permalink
API fixes for CFM-338
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Sep 15, 2025
1 parent 5670b64 commit c6ec2d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/src/Controller/ErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class ErrorController extends AppController
*/
public function initialize(): void
{
// Tell cake to automatically negotiate JSON, which will have the
// most visible side effect of causing stack traces to render as
// JSON instead of HTML
$this->addViewClasses([\Cake\View\JsonView::class]);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/src/Model/Table/ApiUsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace App\Model\Table;

use ArrayObject;
use Cake\Auth\FallbackPasswordHasher;
use Authentication\PasswordHasher\FallbackPasswordHasher;
use Cake\Chronos\Chronos;
use Cake\Event\EventInterface;
use Cake\ORM\RulesChecker;
Expand Down Expand Up @@ -225,8 +225,8 @@ public function validateKey(string $username, string $apiKey, string $remoteIp):

$Hasher = new FallbackPasswordHasher([
'hashers' => [
'Default' => [],
'Weak' => ['hashType' => 'sha1']
'Authentication.Default' => [],
'Authentication.Legacy' => ['hashType' => 'sha1']
]
]);

Expand Down

0 comments on commit c6ec2d3

Please sign in to comment.