Changing the flow to Identifier-First
It's time to update the HTML to change the flow, in the Login form:
<fieldset>
<label for="login_email">E-mail</label>
<input placeholder="email" id="login_email"
required autocomplete="webauthn username">
<section hidden id="login_section_password">
<label for="login_password">Password</label>
<input type="password" id="login_password"
autocomplete="webauthn current-password">
</section>
<section hidden id="login_section_webauthn">
</section>
</fieldset>
Also, in Auth.js we will add a new top-level property and change the logic of init
.
loginStep: 1,
init: () => {
Auth.loginStep = 1;
document.getElementById("login_section_password").hidden = true;
document.getElementById("login_section_webauthn").hidden = true;
},