Closed pox0 closed 3 weeks ago
did you find any solution to that?
Hello, I will try to reproduce it myself and will let you know.
I will add tests for this if they are missing.
Hey @pox0 and @harriskhalil, I added a test (https://github.com/dystcz/lunar-api/pull/173) proving that user actually gets associated with the current cart in session. https://github.com/dystcz/lunar-api/blob/d4737b61f435d1044773bb58b11744499b88d430/tests/Feature/Domain/CartLines/JsonApi/V1/CreateCartLineTest.php#L71-L114
But it only does so during the login process. So if you only send a token of already logged in User
with the request, it will not work, because the \Lunar\Listeners\CartSessionAuthListener
will not be triggered by the Illuminate\Auth\Events\Login
event.
Can you try the following?
POST
to api/v1/cart-lines
to create a CartLine
without the user being logged in.Btw which version are you on? 0.8.x
/ 1.0.0-x
?
We are using laravel/sanctum. When I try to call add-to-cart endpoints. Its creating a cart and cart-lines but it didn't assign to the user. I'm calling the endpoint with authorization bearer token.