How to add email OTP verification during user registration in FilamentPHP before accessing the dashboard? #17171
-
PackageOther Package Versionv3.3.0 How can we help you?I'm using FilamentPHP for user registration, and I want to implement an OTP verification step after the user fills out the registration form but before they are logged in or redirected to the dashboard. What I want to achieve:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
To customize the registration logic, you can create your own Register class by extending the default one: use Filament\Http\Responses\Auth\Contracts\RegistrationResponse;
class Register extends \Filament\Pages\Auth\Register
{
public function register(): ?RegistrationResponse
{
// customize the registration logic
}
}Then, register your custom class in your panel provider: return $panel
...
->registration(Register::class)If you only need to hook into specific parts of the registration process, you can use methods like Check the code here |
Beta Was this translation helpful? Give feedback.
-
|
Was OTP login never considered an option for the Filament team? Something like a config flag to choose between OTP and password authentication. |
Beta Was this translation helpful? Give feedback.
To customize the registration logic, you can create your own Register class by extending the default one:
Then, register your custom class in your panel provider:
If you only need to hook into specific parts of the registration process, you can use methods like
afterValidate,beforeRegister, andafterRegister.Check the code here