davisshaver / wp-rainbow

WordPress Plugin to Enable Sign-In With Ethereum using RainbowKit
https://wp-rainbow.davisshaver.com/
8 stars 5 forks source link

Add option to disable email and password login on `wp-login.php` #47

Open davisshaver opened 1 year ago

davisshaver commented 1 year ago

Inspired by feedback on the WordPress.org forum – do we want to add an option to disable email and password login on wp-login.php?

The code to disable email and password login would look something like this:

remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
remove_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );

One downside to doing this: Site administrators could find themselves locked out if they haven't properly configured RainbowKit Login to recognize their account as an admin account.

Maybe if we add the option to disable email and password login, we could also generate a secret login URL. Something like yoursite.com/wp-login.php?wp_rainbow_secret_login_token=L4JRGJ6F38 where L4JRGJ6F38 is a randomly generated token stored in the database. Then the site admin could save this URL so they can access the site using email and password if needed.