Skip to content

Commit

Permalink
fix: Not unique tokens generated for logged in customers
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverde8 authored Dec 5, 2024
1 parent 6a636fe commit c0307c6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/CommandHandler/Wishlist/CreateNewWishlistHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ public function __invoke(CreateNewWishlist $createNewWishlist): int
/** @var WishlistInterface $wishlist */
$wishlist = $this->wishlistFactory->createNew();
$wishlists = $this->wishlistRepository->findAllByAnonymous($wishlistCookieToken);
}

if ('' !== $wishlistCookieToken) {
$wishlist->setToken($wishlistCookieToken);
if ('' !== $wishlistCookieToken) {
// Set token only for guest users, if not allow unique tokens to be generated.
// This allows us to use the token in the api's and share whishlists created in the web with those
// created with api's.
$wishlist->setToken($wishlistCookieToken);
}
}

if (null !== $createNewWishlist->getChannelCode()) {
Expand Down

0 comments on commit c0307c6

Please sign in to comment.