Skip to content
Snippets Groups Projects
Commit 4e6d1663 authored by David Surville's avatar David Surville
Browse files

Suppression du court-circuitage (je sais ça n'existe pas) lorsqu'une...

Suppression du court-circuitage (je sais ça n'existe pas) lorsqu'une authentification renvoie "true" car sinon les événements "authenticate", "authenticate.success" et "authenticate.fail" ne peuvent pas être utilisés. Ça ne change rien au bon fonctionnemnet de l'authentification.
parent 217c5410
No related branches found
No related tags found
No related merge requests found
Pipeline #14837 passed
......@@ -23,20 +23,20 @@ class AdapterChain extends \ZfcUser\Authentication\Adapter\AdapterChain
$this->getEventManager()->trigger('authenticate.pre', $e);
$result = $this->getEventManager()->triggerUntil(function ($result) {
return $result === true || $result instanceof Response;
return $result instanceof Response;
}, 'authenticate', $e);
if ($result->stopped()) {
$last = $result->last();
if ($last === true || $last instanceof Response) {
if ($last instanceof Response) {
return $last;
}
// throw new Exception\AuthenticationEventException(
// sprintf(
// 'Auth event was stopped without a response. Got "%s" instead',
// is_object($result->last()) ? get_class($result->last()) : gettype($result->last())
// )
// );
throw new Exception\AuthenticationEventException(
sprintf(
'Auth event was stopped without a response. Got "%s" instead',
is_object($result->last()) ? get_class($result->last()) : gettype($result->last())
)
);
}
if ($e->getIdentity()) {
......
......@@ -58,7 +58,7 @@ class LocalAdapter extends AbstractAdapter
// );
}
return true;
return false;
}
/**
......
......@@ -8,9 +8,9 @@ use Zend\EventManager\Event;
* utilisé pour collecter les diverses données concernant l'identité authentifiée.
*
* Exemples de données collectées :
* - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => object(UnicaenAuth\Entity\Db\User))</code>
* - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => object(UnicaenUtilisateur\Entity\Db\User))</code>
* - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => null)</code>
* - <code>array('ldap' => null, 'db' => object(UnicaenAuth\Entity\Db\User))</code>
* - <code>array('ldap' => null, 'db' => object(UnicaenUtilisateur\Entity\Db\User))</code>
* - <code>array('ldap' => null, 'db' => null)</code>
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
......
......@@ -26,7 +26,7 @@ $form->setAttributes([
/** @var AbstractConnectViewHelper[] $helpers */
$helpers = [];
foreach ($types as $t => $config) {
$helpers[$t] = $this->connect($t, $form); /** @see \UnicaenAuth\View\Helper\ConnectViewHelper */
$helpers[$t] = $this->connect($t, $form); /** @see \UnicaenAuthentification\View\Helper\ConnectViewHelper */
}
$activeHelper = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment