Why is my register page always redirecting to `/users`?

What I am trying to do: Redirect users to my main dashboard page after registering. What I did:
return $panel
->default()
->id('app')
->path('/')
->registration(Register::class)
// ...
return $panel
->default()
->id('app')
->path('/')
->registration(Register::class)
// ...
My issue/the error: When logging in users get redirected to /users and I don't understand why. The UserResource has the following restriction:
public static function canAccess(): bool
{
return auth()->user()->role !== 'Patient';
}
public static function canAccess(): bool
{
return auth()->user()->role !== 'Patient';
}
Logging the Filament::getUrl() in the default RegistrationResponse returns https://myappname.uk/users
6 Replies
awcodes
awcodes5w ago
is Register::class a custom registration class?
johncarter
johncarter5w ago
Hello Adam, thanks for replying. Yes it is. Just a couple of removed fields from the form component. No other mods . I ended up binding a new RegistrationResponse, but still feels weird.
awcodes
awcodes5w ago
Yea. I was digging too. Only thing I could see is bail for a logged in user that redirects to intended, but I couldn’t find anything in the code redirecting to /users especially since it’s not a defined route by default in filament. Do you have another panel named ‘users’ by any chance? Possibly something in RouteServiceProvider if it’s a legacy app.
johncarter
johncarter5w ago
Thanks for the insight adam. Only one panel. No route service provider either. It's a mystery.
awcodes
awcodes5w ago
What is the first item in your navigation? getUrl() returns the first item in the navigation manager, that’s the only thing I can think of. If users is your first item then overriding the response would be the correct way to make it work.
johncarter
johncarter5w ago
Thank you sir. That was what it must be. That is an amazing ability - to diagnose problems with limited information and without context. I reqlly appreciate your time Adam, thanks.
Want results from more Discord servers?
Add your server