laravel breeze logout

I have laravel breeze installed. I created the guard customer. But when I logout as a customer the admin also logs out. How can I prevent this?
6 Replies
raheel3031
raheel30312w ago
This route with middelware and guard is stored in routes\auth.php
Route::middleware('auth:customer')->post('logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout');
Route::middleware('auth:customer')->post('logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout');
When clicking on it the admin users also log out. I am assuming the routes of the filament panel are stored somewhere in the system and I don't have to touch them
awcodes
awcodes2w ago
There’s only one authenticated user at a time per session, so if they log out then admin or customer isn’t relevant, that user is logged out.
raheel3031
raheel30312w ago
So what is the solution? When there will be multiple users on the system, will there be just one session?
Povilas K
Povilas K2w ago
I think your use case of being logged in with TWO users at the same time is not correct fundamentally. You either log in with one user, or with another. Then you log out, and then log in with another user. So the behavior of the session is correct - logging out your user's session (both).
Matthew
Matthew2w ago
What do you mean by 'admin also logs out' ? Have you got separate panels and guards ? If so, they should operate independently. But if you've only got one guard, then it will only be one user at any one time per session.
raheel3031
raheel30312w ago
i have only one guard. in the filament panel the user "admin" also logs out when customer-user is logged out and vice versa. but like suggestions of some people here i understand the issue now. in future i will create another panel for other users of the filament panel. i hope it won't create new problems.
Want results from more Discord servers?
Add your server