bbPress Login Widget and Jetpack Protect math puzzle
-
Hi,
First, a quick description of the issue:
When using a bbPress Login Widget in combination with Jetpack and its Protect module activated, logging in via the widget will
1. redirect the user to a stand-alone math puzzle page which in turn (whether the puzzle was solved or failed) will
2. redirect to the normal wp-login.php page where the user will have to
3. fill out login credentials and solve another math puzzle again (!) and after submission, the user is
4. redirected to the dashboard instead of back to the original forum page.So, besides the inconvenience of having to pass the same login credentials twice and solve two different math puzzles, the user will find himself searching for the page he came from, which defeats the whole idea of the login widget…
I found a way to make Jetpack Protect and the bbPress Login Widget work together (by allowing the math puzzle to be inserted directly into the login form in the sidebar) but looking for users to test it in different circumstances like hosting environments, caching plugins etc.
The pull request can be found on https://github.com/Automattic/jetpack/pull/5647
The fix is this:
Open the Jetpack file modules/protect.php for editing (can be done in the WordPress plugin editor) and change:
1. line 53 fromadd_action( 'login_init', array ( $this, 'check_use_math' ) );
to
add_action( 'login_form', array ( $this, 'check_use_math' ) );
2. line 61 from
add_action( 'login_head', array ( $this, 'check_login_ability' ) );
to
add_action( 'login_form', array ( $this, 'check_login_ability' ), 0 );
(notice the added “,0” there at the end too!)
Next Save, activate Jetpack’s Protect module and add the bbPress Login Widget to your forum sidebar. Then visit your site in an anonymous browser window and test logging in via the widget.
Please share your experiences. Thanks !
- You must be logged in to reply to this topic.