Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roots/Bedrock compatibility #22

Open
quentint opened this issue Mar 19, 2024 · 2 comments
Open

Roots/Bedrock compatibility #22

quentint opened this issue Mar 19, 2024 · 2 comments

Comments

@quentint
Copy link

Hi, I think I discovered an incompatibility with this nice plugin and the Roots/Bedrock ecosystem.

They override the wp_set_password function but handle the REST and non-REST cases differently, which breaks bdvs-password-reset. See this implementation: https://github.com/roots/wp-password-bcrypt/blob/5b8542e71578f4540b8dd69c39ae9f156d29c200/wp-password-bcrypt.php#L86

I fixed/hacked this with these lines (because I couldn't find anything better for the moment):

<?php
// my-theme/functions.php

// Hack to fix "bdvs-password-reset" plugin on Roots/Bedrock
add_action('application_password_is_api_request', function(bool $isRest) {
    return false;
}, 10, 2);

I hope this helps and could be fixed 😉

@dominic-ks
Copy link
Owner

Hello @quentint, thanks very much for raising the issue. I've never actually used Bedrock before, nor tested this plugin with it. I'd need to get some time to set up a test site using it to explore this issue and test your proposed change to accommodate it. With limited knowledge on the setup, I wouldn't want to be too quick to make the change without understanding its implications.

What may be good in the meantime is that we could update the docs to show that your suggested code may be required to use the plugin in this instance. As a side note, seems like it would be better to add this in a local custom plugin rather than the theme's functions.php file.

@quentint
Copy link
Author

With limited knowledge on the setup, I wouldn't want to be too quick to make the change without understanding its implications

Same thing for me, this is why I consider my add_action a hack. This is also why I'm afraid mentioning it in the docs might be a bad idea, for now. I'll try to find a better understanding of the issue and propose a better fix.

As a side note, seems like it would be better to add this in a local custom plugin rather than the theme's functions.php file.

Correct!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants