bumbummen99 / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
501 stars 228 forks source link

Laravel Socialite Cognito is destroying the session with Cart on login #183

Closed basiltap closed 1 year ago

basiltap commented 1 year ago

Working in Laravel 9 with LaravelShoppingcart and Socialite Cognito. I have a registration schedule where students can apply for diverse courses and added to the Cart. At the checkout I make an authentication with cognito, but it returns a new session and destroy the last session where the cart is stored.

I have checked the docs and the config files, but I cannot find any point about this.

Can you help me, please?

Working in Laravel 9 with LaravelShoppingcart and Socialite Cognito. I have a registration schedule where students can apply for diverse courses and added to the Cart. At the checkout I make an authentication with cognito, but it returns a new session and destroy the last session where the cart is stored.

I have checked the docs and the config files, but I cannot find any point about this.

Can you help me, please?

bumbummen99 commented 1 year ago

The session option is borked since laravel started clearing the session in the default auth. You will have to adjust your auth controller like this: https://github.com/bumbummen99/LaravelShoppingcartDemo/blob/master/app/Http/Controllers/Auth/LoginController.php

Impor the original login function and manage the cart session yourself on top of it. This should be recatored iMo. as it is not really understandable how it is supposed to work since Laravel changed the way it works.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days