yrccondor / wp-webauthn

🔒 WP-WebAuthn allows you to safely login to your WordPress site without password.
https://wordpress.org/plugins/wp-webauthn
GNU General Public License v3.0
130 stars 15 forks source link

Disable Username Field #62

Open davidmatthewcoleman opened 11 months ago

davidmatthewcoleman commented 11 months ago

It would be great if I could disable the username field, as every browser I've tested works without entering it.

fvdm commented 8 months ago

I agree. I enabled 'Allow to login without username' and set the 'Preferred login method' to 'WebAuthn only', but each time the username field is causing the 1Password suggestions to appear over the Auth button. I have to click those away before getting to the passkey auth.

It would be great if the username field can be removed or hidden. Disabling the suggestions in 1P is not an option because they are handy for non-passkey sites.

For now I did a little hack:

/my-theme/functions.php

function my_login_css() {
  wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
}

add_action( 'login_enqueue_scripts', 'my_login_css' );

/my-theme/style-login.css

.wwa-webauthn-only label,
.wwa-webauthn-only input {
  display: none;
}