Open arshaviras opened 2 weeks ago
Hi @arshaviras – have you registered the plugin on both panels?
No, only on Student Panel
@arshaviras Okay, I think I see the problem. The registered routes use the guest
middleware, but that defaults to checking against the default auth guard which I imagine is your regular User
/ admin panel.
Have you specified the custom auth guard on your panel too, using the authGuard()
method?
Yes I have custom auth guard ->authGuard('web:students')
So what I need to change/add and where?
Thanks
I think I need to change something there, but what I can't imagine
public function register(Panel $panel): void { $panel ->login(Login::class) ->routes(function () { Route::get('/auth/{user}/link', LoginLinkController::class) ->middleware(['signed', 'guest']) ->name('auth.link'); }); }
We'll need to make a change to support this inside of the package. I'll update this issue once the release has been tagged.
What happened?
I have two panels one is Admin and second is Student. I have Student Model which extends Authenticatable and implements FilamentUser. I want to generate passwordless links and send to students and they can login via magic link. In plugin I changed all User models to Student model. Also changed in file PasswordlessLogin.php
return URL::temporarySignedRoute('filament.' . Filament::getCurrentPanel()->getId() . '.auth.link', now()->addMinutes(30), $user);
toreturn URL::temporarySignedRoute('filament.' . 'student' . '.auth.link', now()->addMinutes(30), $user);
becauseFilament::getCurrentPanel()->getId()
return 'admin', because I generating links from Admin Panel for Student Panel. Added Action on Table and generated login link for student user.How to reproduce the bug
When I trying to login via that generated link it redirect to login page. In addition I can login with email and password via plugin's custom login page.
What I need to change/add for success authenticating?
Package Version
0.3.0
PHP Version
8.2.12
Laravel Version
11.10.0
Which operating systems does with happen with?
Windows
Notes
No response