The written AuthenticationProvider is compatible with different "user bundles" like the one from fos. But, we can not use our own implementation for a user, because the real implementation, instead of an interface (which could contain the cart api etc.), of the commercetools user class is checked.
if ($user instanceof User) {
$user->setId($customer->getId());
$cart = $result->getCart();
if (!is_null($cart)) {
$user->setCartId($cart->getId());
$user->setCartItemCount($cart->getLineItemCount());
}
}
Please extract the added user api to an interface and check against this interface.
The written AuthenticationProvider is compatible with different "user bundles" like the one from fos. But, we can not use our own implementation for a user, because the real implementation, instead of an interface (which could contain the cart api etc.), of the commercetools user class is checked.
Please extract the added user api to an interface and check against this interface.