-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Bug]: Redirecting to wrong panel #2
Comments
Thank you for your clear explanation of the bug! I'm very sure it has something to do with the response. Tomorrow I have time to take a look at it, I will let you know when I fixed it :) @CodeWithDennis |
No problem! Here is some more information. The method // Currently
public function store(TwoFactorLoginRequest $request)
{
...
return app(TwoFactorLoginResponse::class);
} // Should be
public function store(TwoFactorLoginRequest $request)
{
...
return app(\Vormkracht10\TwoFactorAuth\Http\Responses\TwoFactorLoginResponse::class);
} The only issue now is that the response is returning the main panel route instead of the panel using 2FA. (Which is the main issue) return redirect()->intended(Filament::getCurrentPanel()->getUrl()); That's as far as I've gotten. |
I've made some changes in the 2-bug-redirecting-to-wrong-panel branch but in my local repository it still doesn't redirect to the correct panel. Can you verify that it isn't working correctly when checking out that branch? I'm not sure if I have setup the panels correctly. @CodeWithDennis |
Yes it still redirects to the main panel. @Baspa |
If you use |
Alright, thanks for checking. I think I've built something like that in a project, will check it later today / tomorrow. |
It should be fixed now, can you double check it for me please? Tagged it with tag v1.0.3 @CodeWithDennis |
Yes! Works perfectly, nice work! |
What happened?
When adding the 2FA on a panel that isn't the main one, the user will be redirected to the main panel instead of the one where 2FA is set up. For example, if the panel is
/customer/login
, the user will be redirected to/employees/login
, as that's the main panel.How to reproduce the bug
Set up two panels: one for customers and one for employees, and place the login on the employees panel and try logging in (with code).
Package Version
1.0.0
PHP Version
8.2
Laravel Version
10.10
Which operating systems does with happen with?
macOS
Notes
(It likely has to do with the response. You might want to retrieve the
Filament::getCurrentPanel()
and then get the route from there.)The text was updated successfully, but these errors were encountered: