Two panels with two auth guards, logges me out from both
I have two panels: admin and partner. First is using the web guard, second the partner guard (see config/auth.php):
It works. When navigating to
/admin
I can login as admin, and when going to /partner
I can login as a partner. Now I am logged in as 2 different users as expected.
But when I click on logout on one of the panel, I am logged out in the other panels as well. That makes no sense?
When putting on of the panels on a (sub-)domain, then it works as well, but when I log out from one, I stay logged in in the other panel (this is the expected behaviour IMHO).7 Replies
Hello, did you find the solution? I have the same issue.
@vitsw Sorry for late reply. I didn't find a solution, so I moved the panels on different subdomains. Not pretty, not optimal, not what i wanted, but it works
@vitsw Added an issue for it https://github.com/filamentphp/filament/issues/9459
GitHub
Logout button logs out from all panels, not just the current (authg...
Package filament/filament Package Version v3.0.89 Laravel Version v10.30.1 Livewire Version No response PHP Version 8.1.25 Problem description When creating 2 panels, which both have their own auth...
Hi , I have the same issue .if you get any solution so please share it .
I have found a solution for this.
Create a LogoutController inside "app/Overrides/LogoutController.php" and paste the code .
update composer.json file . and run composer dump-autoload.
That would be a great article for https://filamentphp.com/community
Thank you, @Sourabh
Unfortunately your approach didn't work for me. Instead, I had to remove your composer.json modifications and add an alias to the default LoginController in my AppServiceProvider, as follows:
And I made some modifications to your LogoutController to keep it simpler and without the need to know the name of the panels and their guards:
I believe this is a candidate for a pull request
Might be because of
https://discordapp.com/channels/883083792112300104/883085267383226478/935484862788407336