WP-API / Basic-Auth

Basic Authentication handler for the JSON API, used for development and debugging purposes
761 stars 281 forks source link

Wrong login turns into a PHP Error #33

Open enricodeleo opened 8 years ago

enricodeleo commented 8 years ago

This is related to #27

Using wrong credentials, Wordpress automatically calls a function that generates the lost password login. Since this plugin hook an event that occurs early, the method that produces permalinks is not already available and generates an error.

Hooking the plugin after that moment make the login feature unavailable. It seems that hacking the plugin adding

$GLOBALS['wp_rewrite'] = new WP_Rewrite();

avoid this error but generates another one

Undefined property: WP_Error::$ID in /srv/www/test.com/current/wp/wp-includes/class-wp-user.php on line 165

It's a e_notice so think it could be ignored, but I am wondering if there is any way of make basic auth 100% working without errors at all. Any ideas?