Open Thinkscape opened 10 years ago
Is there a use case for why it shouldn't overwrite?
My concern isthat if you have two adapters, A and B, and A doesn't find a matching user but B does you'll end up with a messages array that looks like this:
// AdapterChainEvent->getMessages()
array(
'A record with the supplied identity could not be found.',
'Authentication successful.',
);
Or, if they both fail, this:
// AdapterChainEvent->getMessages()
array(
'A record with the supplied identity could not be found.',
'A record with the supplied identity could not be found.',
);
i.e.
Because of https://github.com/ZF-Commons/ZfcUser/blob/master/src/ZfcUser/Authentication/Adapter/Db.php#L78 the Db adapter will override any previously set messages (i.e. when there are other adapters in the chain before it).
We should think about
AdapterChainEvent::addMessage()
ands/setMessages/addMessage/g
.