fix WWW-Authenticate

This commit is contained in:
Taras Machyshyn
2013-11-25 12:09:57 +02:00
parent 94a13bfbdb
commit 8f82770ba3
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ EOT;
return array(
'controller' => 'Settings',
);
});
})->conditions( array('auth' => false) );
$this->getSlim()->map('/settings/', function() {
return array(
'controller' => 'Settings',
+2 -4
View File
@@ -10,8 +10,6 @@ class Auth extends \Slim\Middleware
private $container;
protected $realm = '';
public function __construct(\Doctrine\ORM\EntityManager $entityManager, \Espo\Core\Container $container)
{
$this->entityManager = $entityManager;
@@ -60,11 +58,11 @@ class Auth extends \Slim\Middleware
if ($isAuthenticated) {
$this->next->call();
} else {
$res->header('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realm));
$res->header('WWW-Authenticate');
$res->status(401);
}
} else {
$res->header('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realm));
$res->header('WWW-Authenticate');
$res->status(401);
}
}