Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #272 - Not unique tokens generated for logged in customers #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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