You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I just discovered that calling endpoints with the basic authentication generates randomly the error (fortunately the majority of calls don't generate any error) BadMethodCallException: Call to a member function get_page_permastruct() on a non-object (NULL)
The stack trace points to /wp-includes/link-template.php(314): _get_page_link().
I'm using the v2 wp rest api plugins and seems that the origin of the error is when this plugin does wp_authenticate.
Any ideas about it?
UPDATE
The error is related to the wp_lostpassword_url function that is triggered during login. Apparently the function is called during the authentication process in order to return an url where the user could recover his own password. At this point WP isn't able to generate the permalink (may be it is too early). Does anyone know how to disable this call? I implemented a custom password recovery system by the way, so I will never need the build-in method.
The text was updated successfully, but these errors were encountered:
Sometimes, with an incorrect username and password (or using email address rather than username, which made `wp_authenticate_username_password` error) when `$user = wp_authenticate( $username, $password );` errored, it would call `$wp_rewrite->get_page_permastruct();` before `$wp_rewrite` was initialized, returning a 500 server error. In my case, this would happen when I enabled the SkyVerge WooCommerce Print Invoices/Packing Lists plugin.
BrianHenryIE
added a commit
to BrianHenryIE/Basic-Auth
that referenced
this issue
Aug 9, 2017
Hi!
I just discovered that calling endpoints with the basic authentication generates randomly the error (fortunately the majority of calls don't generate any error)
BadMethodCallException: Call to a member function get_page_permastruct() on a non-object (NULL)
The stack trace points to
/wp-includes/link-template.php(314): _get_page_link()
.I'm using the v2 wp rest api plugins and seems that the origin of the error is when this plugin does wp_authenticate.
Any ideas about it?
UPDATE
The error is related to the
wp_lostpassword_url
function that is triggered during login. Apparently the function is called during the authentication process in order to return an url where the user could recover his own password. At this point WP isn't able to generate the permalink (may be it is too early). Does anyone know how to disable this call? I implemented a custom password recovery system by the way, so I will never need the build-in method.The text was updated successfully, but these errors were encountered: