Skip to content

Commit

Permalink
chore: Use MetaData service’s getAppName method rather than directl…
Browse files Browse the repository at this point in the history
…y accessing config value
  • Loading branch information
hellopablo committed May 14, 2024
1 parent e905d6e commit 6299c0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Common/Controller/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@ protected function passwordProtectedRequest(): void
$oInput = Factory::service('Input');
/** @var ErrorHandler $oErrorHandler */
$oErrorHandler = Factory::service('ErrorHandler');
/** @var MetaData $oMetaData */
$oMetaData = Factory::service('MetaData');

// Send headers immediately
header('WWW-Authenticate: Basic realm="' . Config::get('APP_NAME') . ' - Restricted Area"');
header('WWW-Authenticate: Basic realm="' . $oMetaData->getAppName() . ' - Restricted Area"');
header($oInput->server('SERVER_PROTOCOL') . ' 401 Unauthorized');

$oErrorHandler->show401(null, null, true, true);
Expand Down

0 comments on commit 6299c0f

Please sign in to comment.