<form> <labelfor="username">Username</label> <inputname="username"type="text"id="username"placeholder="Type your username here"autocomplete="username"> <labelfor="password">Password</label> <inputname="password"type="password"id="password"placeholder="Type your password here"autocomplete="password"> <buttontype="submit"> Sign in </button></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.
<form> <labelfor="username">Username</label> <input name="username" type="text" id="username" placeholder="Type your username here" autocomplete="username webauthn">
<buttontype="submit"> Sign in </button></form>
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.