Skip to content

Commit

Permalink
add security salt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 14, 2026
1 parent 6efb22b commit 64c09e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@
require dirname(__DIR__) . '/config/bootstrap.php';

// Ensure Security salt is set for tests (needed by CSRF middleware, hashes, etc).
// In CI we inject it via env (COMANAGE_REGISTRY_SECURITY_SALT).
if (!Security::getSalt()) {
$salt = getenv('COMANAGE_REGISTRY_SECURITY_SALT') ?: 'phpunit-security-salt';
Security::setSalt($salt);
}

// Security::getSalt() throws when not set, so don't call it to check.
$salt = getenv('COMANAGE_REGISTRY_SECURITY_SALT') ?: 'phpunit-security-salt';
Security::setSalt($salt);

if (empty($_SERVER['HTTP_HOST']) && !Configure::read('App.fullBaseUrl')) {
Configure::write('App.fullBaseUrl', 'http://localhost');
Expand Down

0 comments on commit 64c09e1

Please sign in to comment.