Consider the following login form.
First step is to remove the password field that is no longer needed. In addition, we can indicate the autocomplete method is webauthn
; this helps browser understanding the purpose of this field.
We now have only two Twig functions to call: stimulus_controller
and stimulus_action
.
The first one is placed on the form
level;
The latter on the button
.
The Stimulus Controller should be configured to fits on your needs. In particular, the routes to the options and authenticator result. The route names used below are automatically created by the firewall from the bundle package. By using these values, we make sure the routes are always in line with the firewall configuration.