Require Login/Register to Execute Action
I have a public page (Livewire component) with a Filament form:
I wish to submit this form and execute some code after the user logs in or registers...
The flow would be:
- Fill out the form
- Click the submit button
- Register or Login
- Use that user recently created or logged user to execute some code
Is that possible using the Filament login/register form?
7 Replies
maybe a custom middleware to redirect the user to this form after login/register?
I'm not sure what to do, but I wanted the user to fill the form before the login, and then create everything that they filled after the login or register
but I'll check if I can do it with middlewares
It might be easier to override the existing Login class unless you absolutely need full customization.
this form is for something else, to gather data to create a reservation and a vehicle for that user.
Fair enough. In that case I agree with Leandro.
don't know if this is the best solution, but I did:
In the public page:
Then created a listener that listen to
Filament\Events\Auth\Registered
, to handle the processsing of that bookingIf it works, it’s not wrong.